Skip to content

Commit f9b6ff0

Browse files
mrclayscottgonzalez
authored andcommitted
add: Make it more obvious that add() doesn't mutate
Fixes gh-565 Closes gh-566
1 parent ae9390d commit f9b6ff0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

entries/add.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<desc>The point in the document at which the selector should begin matching; similar to the context argument of the <code>$(selector, context)</code> method.</desc>
3535
</argument>
3636
</signature>
37-
<desc>Add elements to the set of matched elements.</desc>
37+
<desc>Create a new jQuery object with elements added to the set of matched elements.</desc>
3838
<longdesc>
3939
<p>Given a jQuery object that represents a set of DOM elements, the <code>.add()</code> method constructs a new jQuery object from the union of those elements and the ones passed into the method. The argument to <code>.add()</code> can be pretty much anything that <code>$()</code> accepts, including a jQuery selector expression, references to DOM elements, or an HTML snippet.</p>
4040
<p>Do not assume that this method appends the elements to the existing collection in the order they are passed to the <code>.add()</code> method. When all elements are members of the same document, the resulting collection from <code>.add()</code> will be sorted in document order; that is, in order of each element's appearance in the document. If the collection consists of elements from different documents or ones not in any document, the sort order is undefined. To create a jQuery object with elements in a well-defined order and without sorting overhead, use the <code>$(array_of_DOM_elements)</code> signature.</p>

0 commit comments

Comments
 (0)