.remove() does remove the element from the document head or body, but that
doesn't destroy it. It just makes it available for garbage collection - if
there are no other references to the element.
For example:
var $div = $('test');
$div.appendTo('body');
$div.remove();
Here we've created a new DI
Hmm. .remove() doesn't just hide an element; It removes it:
if ( this.parentNode ) {
this.parentNode.removeChild( this );
}
(from the source)
To prevent memory leaks, it also removes event handlers associated
with it. As of jQuery 1.4, it also removes data assoc
2 matches
Mail list logo