As the title states, If I have a jQuery listener tied to an HTML element, and then delete the HTML element from the DOM using jQuery what happens?
<div id="eventDiv> ... </div>
// event handling code here
then what happens to the listener when I do
Also, what happens if you don't use jQuery and use document.removeChild()?
If you look at the jQuery source,
remove() calls a function called
cleanData which calls
jQuery.removeEvent (this seems to be an internal function). These methods eventually call
unbind() which removes any event listeners for the DOM element that you are deleting.