diff options
author | John Resig <jeresig@gmail.com> | 2006-08-17 05:14:50 +0000 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2006-08-17 05:14:50 +0000 |
commit | 2a4c269a9b7c15477e032a24f92d08dfaeb026e4 (patch) | |
tree | 07b11d0cbb727184c66dea04e7a6e4a1ee09118c | |
parent | 26580d2675918bb689d55293e734e68671b4dfc6 (diff) | |
download | jquery-2a4c269a9b7c15477e032a24f92d08dfaeb026e4.tar.gz jquery-2a4c269a9b7c15477e032a24f92d08dfaeb026e4.zip |
Added a new clone function.
-rw-r--r-- | src/jquery/jquery.js | 6 |
1 files changed, 6 insertions, 0 deletions
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 |