]> source.dussan.org Git - jquery.git/commitdiff
Added a new clone function.
authorJohn Resig <jeresig@gmail.com>
Thu, 17 Aug 2006 05:14:50 +0000 (05:14 +0000)
committerJohn Resig <jeresig@gmail.com>
Thu, 17 Aug 2006 05:14:50 +0000 (05:14 +0000)
src/jquery/jquery.js

index 846c8154124ce63b510eb2736af3122ff5025263..9d80d050cf6ebd0821fc6cedb236608bcfb3cc3c 100644 (file)
@@ -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