I am using jQuery and I would like to know if the remove () method clears its contents of event handlers. For instance:
function someFunction() { var element = $('<div></div>'); element.click(function() { alert('bar'); }); $('body').append(element); element.remove(); }
At this point, is the memory still listening to events? If so, is there a way to clear the event handler element before deleting it from the DOM?
source share