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

# .not()

`.not()` removes elements from a selected list.

Use it when you want everything except something.

***

#### Syntax

```js
elementList.not(selector);
elementList.not(node);
elementList.not(callback);
```

***

#### Parameters

* `selector` → elements to exclude
* `node` → element to exclude
* `callback` → custom condition that returns `true` for items to exclude

***

#### Output

```js
Array<HTMLElement>
```

***

#### Example

```js
$('.tab*')
  .not('.active')
  .forEach(tab => tab.removeClass('selected'));
```

```js
const visibleCards = $('.card*').not(card => card.hasClass('hidden'));
```

***

#### Key Takeaway

> `.not()` means “give me the list, except these ones.”
