From 4eb02b0ee018f74972ff1a5e4a406b1b362e27cc Mon Sep 17 00:00:00 2001 From: Manuel Strehl Date: Wed, 18 Mar 2015 21:36:13 +0100 Subject: [PATCH 1/2] siblings: explain, that original elements might be returned, too This edit is motivated by . --- entries/siblings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/siblings.xml b/entries/siblings.xml index d6b1be02..d26c372c 100644 --- a/entries/siblings.xml +++ b/entries/siblings.xml @@ -26,7 +26,7 @@ $( "li.third-item" ).siblings().css( "background-color", "red" );

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.

-

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.

+

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 $set.siblings().not($set).

Find the unique siblings of all yellow li elements in the 3 lists (including other yellow li elements if appropriate). From 88f0afc9cc07e8ec8e32e094d49127ccf71c77cd Mon Sep 17 00:00:00 2001 From: Manuel Strehl Date: Thu, 26 Mar 2015 14:33:25 +0100 Subject: [PATCH 2/2] Change wording from "set" to "collection" Thanks to @arthurvr for pointing it out. --- entries/siblings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/siblings.xml b/entries/siblings.xml index d26c372c..cb9e6e0b 100644 --- a/entries/siblings.xml +++ b/entries/siblings.xml @@ -26,7 +26,7 @@ $( "li.third-item" ).siblings().css( "background-color", "red" );

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.

-

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 $set.siblings().not($set).

+

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 collection contains more than one element, they might be mutual siblings and will both be found. If you need an exclusive list of siblings, use $collection.siblings().not($collection).

Find the unique siblings of all yellow li elements in the 3 lists (including other yellow li elements if appropriate).