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

# .is()

Checks whether an element matches a selector or is the same DOM node as another element.

```javascript
const submit = $('#submit');

if (submit.is('form button')) {
  submit.addClass('inside-form');
}
```

```javascript
const selected = $('.tab.active');

if ($('#tab-one').is(selected)) {
  console.log('Tab one is active');
}
```
