From: John Resig Date: Thu, 17 Aug 2006 05:14:50 +0000 (+0000) Subject: Added a new clone function. X-Git-Tag: 1.0~32 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2a4c269a9b7c15477e032a24f92d08dfaeb026e4;p=jquery.git Added a new clone function. --- diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 846c81541..9d80d050c 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -557,6 +557,12 @@ jQuery.fn = jQuery.prototype = { return jQuery.find(t,a); }), 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