Added a new clone function.

This commit is contained in:
John Resig 2006-08-17 05:14:50 +00:00
parent 26580d2675
commit 2a4c269a9b

View file

@ -557,6 +557,12 @@ jQuery.fn = jQuery.prototype = {
return jQuery.find(t,a); return jQuery.find(t,a);
}), arguments ); }), arguments );
}, },
clone: function(deep) {
return this.pushStack( jQuery.map( this, function(a){
return a.cloneNode( deep != undefined ? deep : true );
}), arguments );
},
/** /**
* Removes all elements from the set of matched elements that do not * Removes all elements from the set of matched elements that do not