Commit 2a4c269a authored by John Resig's avatar John Resig

Added a new clone function.

parent 26580d26
...@@ -557,6 +557,12 @@ jQuery.fn = jQuery.prototype = { ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment