siblings

UK ['sɪblɪŋz] US ['sɪblɪŋz]

n.Brothers, sisters (plural noun of sibling)

jquery siblings() method syntax

Function:siblings() Gets the siblings of each element in the matching set. Filtering through the selector is optional.

Syntax:.siblings(selector)

Parameters:

Parameter Description
selector String value, containing the selector expression used to match elements.

Description:If given a jQuery object that represents a collection of DOM elements, the .siblings() method allows us to search for these elements in the DOM tree. Sibling elements and constructs a new jQuery object with the matching element. This method accepts an optional selector expression of the same type as the argument we passed into the $() function. If this selector is applied, elements will be filtered by testing whether they match the selector.

jquery siblings() method example

    
Hello

Hello Again

And Again

Run instance »

Click the "Run instance" button to view the online instance