jQuery Click element, then remove it

hope your well.

Im stuck with a concept, not sure if my logic is right, it most likely isn’t.

I’m hoping t achieve a div delete. So I click the div and it makes it the active div and then i can delete it with the backspace key.

So the flow is -. Click Element – Hit Backspace – $ (this).remove();

but Not sure how to target the element with a click. I had

$  (".spike").live(event, function(del) {
  if (del.keyCode == 8) { $  (this).remove();}
});

but it doesnt work.(event is bound to click and ipad touch)

basically is there anyway i can use the click event to target a div, maybe to a gobal variable? that then allows me perform actions to it?

thanks

newest questions tagged jquery – Stack Overflow

About Admin