---
title: "Selection.find(selector) | Grafana k6 documentation"
description: "Find the selection descendants, filtered by a selector."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Selection.find(selector)

Find the selection descendants, filtered by a selector. It returns a [Selection](/docs/k6/latest/javascript-api/k6-html/selection/) object. Mimics [jquery.find](https://api.jquery.com/find/)

Expand table

| Parameter | Type   | Description                                                          |
|-----------|--------|----------------------------------------------------------------------|
| selector  | string | A string containing a selector expression to match elements against. |

### Returns

Expand table

| Type                                                           | Description       |
|----------------------------------------------------------------|-------------------|
| [Selection](/docs/k6/latest/javascript-api/k6-html/selection/) | Selection object. |

### Example

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
import { parseHTML } from 'k6/html';
import http from 'k6/http';

export default function () {
  const res = http.get('https://k6.io');
  const doc = parseHTML(res.body);

  const titleDoc = doc.find('head title');
  const title = titleDoc.text();
}
```
