I have a question.
I need to remove a div on click in jQuery. Not display: none; but remove.
$(“#div”).live(‘click’, function(){
$(this)._ _ _ _ _ _ _ _ ; });
And what’s the difference between .live('click') and .click()
Thanks !
EDIT : THANKS A LOT GUYS FOR YOUR ANWSERS
Now, I have div1 inside div2.
I need to remove div1 when I click on div1. But when I clicked on div2, div1 is removed…
Why ?
Click only works for existing DOM elements, live also takes account of elements that are added to the DOM later.