jQuery nextUntil()

Introduction

The nextUntil() method returns all next sibling elements between the selector and stop.

Sibling elements are elements that share the same parent.

If both parameters are empty, this method will return all next sibling elements.

$(selector).nextUntil(stop,filter)
Parameter
Optional
Description
stop


Optional.


A selector expression,
element or
jQuery object indicating where to stop the search
filter

Optional.

a selector expression to narrow down the search
To return multiple siblings, separate each expression with a comma.

Return all sibling elements between two <li> elements with class name "start" and "stop":




PreviousNext

Related