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 846c815..9d80d05 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