Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
siblings: explain, that original elements might be returned, too
This edit is motivated by <jquery/jquery#2149>.
  • Loading branch information
Boldewyn committed Mar 18, 2015
commit 4eb02b0ee018f74972ff1a5e4a406b1b362e27cc
2 changes: 1 addition & 1 deletion entries/siblings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
$( "li.third-item" ).siblings().css( "background-color", "red" );
</code></pre>
<p>The result of this call is a red background behind items 1, 2, 4, and 5. Since we do not supply a selector expression, all of the siblings are part of the object. If we had supplied one, only the matching items among these four would be included.</p>
<p>The original element is not included among the siblings, which is important to remember when we wish to find all elements at a particular level of the DOM tree.</p>
<p>The original element is not included among the siblings, which is important to remember when we wish to find all elements at a particular level of the DOM tree. However, if the original set contains more than one element, they might be mutual siblings and will both be found. If you need an exclusive list of siblings, use <code>$set.siblings().not($set)</code>.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick about the wording: In general we've been using collection or just jQuery object, not set in most of the documentation. Especially since these days set might confuse beginners (ES6 Sets, Angular $set method, ...)

</longdesc>
<example>
<desc>Find the unique siblings of all yellow li elements in the 3 lists (including other yellow li elements if appropriate).</desc>
Expand Down