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

# .parent()

Returns the immediate parent element. Pass a selector to search upward for the nearest matching parent by tag, class, or id.

```javascript
const input = $('#email');

input.parent().addClass('field');
input.parent('.form-group').addClass('has-email');
input.parent('#signup-form').addClass('active-form');
```
