> 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/.parentuntil.md).

# .parentUntil()

Returns all parent elements from the current element up to, but not including, a target element. Use it to style or inspect a parent chain.

```javascript
const button = $('#save-profile');

button.parentsUntil('main').addClass('save-path');
```
