jQuery element ~ siblings Selector (original) (raw)
Last Updated : 11 Jul, 2025
The element ~ siblings selector in jQuery is used to select all elements that are siblings of the specified element.
Syntax:
("element ~ siblings")
Parameter: It contains two parameters as mentioned above and described below:
- element: It is a required parameter and is used for any valid jQuery selector.
- siblings: It is a required parameter and is used for specifying the siblings of the element parameter.
Example 1:
HTML `
jQuery element ~ siblings SelectorGeeksforGeeks
jQuery element ~ siblings Selector
Geeks1
Geek2
Geeks3
Geek4
Geeks5
Geek6
`
Output:

Example 2:
HTML `
jQuery element ~ siblings SelectorGeeksforGeeks
jQuery element ~ siblings Selector
Geeks1
Geek2
Geeks3
Geek4
Geeks5
Geek6
`
Output:
