Get the siblings of each element (excluding the element) in the set of matched elements, optionally filtered by a selector.
$('.pear').siblings().length;//=> 2$('.pear').siblings('.orange').length;//=> 1
The siblings.
https://api.jquery.com/siblings/
Optional
If specified filter for siblings.
Get the siblings of each element (excluding the element) in the set of matched elements, optionally filtered by a selector.
Example
Returns
The siblings.
See
https://api.jquery.com/siblings/