I am using JQuery, and I would like to know if the remove() method cleans 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 there an event handler still hanging out in memory? If so, is there a way to clear the element object of event handlers before removing it from the DOM?
According to jquery docs: