Return all next sibling elements of each <li> element with class name "start":
Result:
The nextAll() method returns all next sibling elements of the selected element.
Sibling elements are elements that share the same parent.
The DOM tree: This method traverse forward along siblings of DOM elements.
Related methods:
Parameter | Description |
---|---|
filter | Optional. Specifies a selector expression to narrow down the search for
next siblings Note: To return multiple siblings, separate each expression with a comma. |
Narrow down the search
How to filter the search for next sibling elements.
Return multiple siblings
How to use the filter parameter to return all siblings of a <h2> element that
have class names "1", "2" and "3".
Select
all next sibling elements of a <p> element
How to select all next sibling elements of a <p> element.
Select
all next sibling <p> elements of <div>
How to select all next sibling <p> elements of each <div> element.