(Note: I\'m using jQuery below, but the question is really a general Javascript one.)
Say I\'ve got a div#formsection
whose contents are repeatedly upda
I wanted to know myself so after a little test, I think the answer is yes.
removeEvent is called when you .remove() something from the DOM.
If you want see it yourself you can try this and follow the code by setting a breakpoint. (I was using jquery 1.8.1)
Add a new div first:
$('body').append('')
Check$.cache
to make sure there is no events attached to it. (it should be the last object)
Attach a click event to it:
$('#test').on('click',function(e) {console.log("clicked")});
Test it and see a new object in$.cache
:
$('#test').click()
Remove it and you can see the object in$.cache
is gone as well:
$('#test').remove()