> For the complete documentation index, see [llms.txt](https://jscula.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jscula.gitbook.io/docs/traversal/.nextuntil.md).

# .nextUntil()

`.nextUntil()` gets all next sibling elements until it reaches a target.

***

#### Syntax

```js
element.nextUntil(selector);
element.nextUntil(node);
```

***

#### Parameters

* `selector` → selector where selection should stop
* `node` → DOM node where selection should stop

***

#### Output

```js
NodeList | HTMLCollection | null
```

***

#### Example

```js
$('.step.current')
  .nextUntil('.step.complete')
  .addClass('pending');
```

***

#### Key Takeaway

> `.nextUntil()` collects the next siblings before a stopping point.
