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

# .find()

## `.find()`

`.find()` searches **inside an already selected element**.

Use it when you do not want to search the entire page.

```js
$('#profile').find('.name');
```

This means: “inside `#profile`, find `.name`.”

***

#### Syntax

```js
element.find(selector);
element.find(selector*);
```

***

#### Parameters

* `selector` → CSS selector string
* `*` → returns all matching children

***

#### Output

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

***

#### Basic Example

```js
const profile = $('#profile');

profile.find('.name').text('Ada Lovelace');
```

***

#### Finding Multiple Children

```js
$('#menu')
  .find('a*')
  .addClass('menu-link');
```

***

#### When Should You Use `.find()`?

Use `.find()` when:

* You already selected a parent
* You only want children inside that parent
* You want to avoid accidentally selecting elements from another section

***

#### Key Takeaway

> `$()` searches the page.\
> `.find()` searches inside something you already selected.
