Traversing Siblings
π
2026-06-18 | π jQuery
# jQuery siblings() Method
[ jQuery Traversing Methods](#)
## Example
Return all sibling elements of each `
` element with the class name "start":
```javascript
$(document).ready(function(){
$("li.start").siblings().css({"color":"red","border":"2px solid red"});
});
Result:
ul (parent)
* li (sibling)
* li (sibling)
* li (sibling with class name "start")
* li (sibling)
* li (sibling)
[Try it Β»](#)
* * *
## Definition and Usage
The `siblings()` method returns all sibling elements of the selected element.
Sibling elements are elements that share the same parent element.
**DOM Tree:** This method traverses forward and backward through the sibling elements of DOM elements.
**Tip:** Use the [prev()](#) or [next()](#) method to narrow the search to only the previous or next sibling element.
* * *
## Syntax
```javascript
$(selector).siblings(filter)
| Parameter | Description |
| :--- | :--- |
| *filter* | Optional. A selector expression to narrow the search for sibling elements. |

## More Examples
(#)
How to use two parameters to filter the search for sibling elements.
[Select all sibling `` elements of each `
` element](#)
How to narrow the search to all sibling `
` elements of each `
` element.
* * jQuery Traversing Methods](#)