I’m stuck with a concept, not sure if my logic is right, it most likely isn’t.
I’m hoping to 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 doesn’t work. (The event is bound to click and ipad touch).
Basically is there any way I can use the click event to target a div, maybe to a global variable, that then allows me perform actions to it?
Well the idea is to select an item, and save the selection. Then if the key you want is pressed, delete that item.
Look at this example:
http://jsfiddle.net/GVgEy/5/