// Remove all child nodes of the set of matched elements from the DOM
// This method does not accept any arguments.
$("div.parent").empty();
// Remove all child nodes of the set of matched elements from the DOM
// This method does not accept any arguments.
$("div.parent").empty();
$("button").click(function(){
$("div").empty();
});
empty: function() {
var elem,
i = 0;
for ( ; ( elem = this[ i ] ) != null; i++ ) {
if ( elem.nodeType === 1 ) {
// Prevent memory leaks
jQuery.cleanData( getAll( elem, false ) );
// Remove any remaining nodes
elem.textContent = "";
}
}
return this;
}