Skip to content

Commit 765fd69

Browse files
committed
.clone() ignores dynamic state on purpose. Close jquerygh-90.
1 parent 3d4b0f3 commit 765fd69

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

entries/clone.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
</signature>
1919
<desc>Create a deep copy of the set of matched elements.</desc>
2020
<longdesc>
21-
<p>The <code>.clone()</code> method performs a <em>deep</em> copy of the set of matched elements, meaning that it copies the matched elements as well as all of their descendant elements and text nodes. When used in conjunction with one of the insertion methods, <code>.clone()</code> is a convenient way to duplicate elements on a page. Consider the following HTML:</p>
21+
<p>The <code>.clone()</code> method performs a <em>deep</em> copy of the set of matched elements, meaning that it copies the matched elements as well as all of their descendant elements and text nodes. For performance reasons, the dynamic state of form elements (e.g., user data typed into <code>input</code>, and <code>textarea</code> or user selections made to a <code>select</code>) is not copied to the cloned elemements. The clone operation sets these fields to their default values as specified in the HTML.</p>
22+
<p>When used in conjunction with one of the insertion methods, <code>.clone()</code> is a convenient way to duplicate elements on a page. Consider the following HTML:</p>
2223
<pre><code>&lt;div class="container"&gt;
2324
&lt;div class="hello"&gt;Hello&lt;/div&gt;
2425
&lt;div class="goodbye"&gt;Goodbye&lt;/div&gt;

0 commit comments

Comments
 (0)