> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# SelectorQuery: selectAll() method

APISummary
Select all nodes that match the specified CSS selector under the root node specified by `SelectorQuery`.

## Syntax

```ts
selectAll(selector: string): NodesRef;
```

### Parameters

#### selector

CSS selector combination used for matching nodes. All nodes that match the specified selector combination will be returned.

The CSS selector used for matching nodes must be [CSS selectors supported by `select()`](/next/api/lynx-api/selector-query/selector-query-select.md#selector).

### Return Value

A `NodesRef` object instance representing this query result.

Please note that at this time, `SelectorQuery` will only save the query parameters provided by the user in the `NodesRef` object and will not execute the query immediately. Therefore, it is **NOT feasible** to view node information or determine whether the node can be found in the following way:

```js
let nodesRef = lynx.createSelectorQuery().selectAll('#the-id');
console.log(nodesRef); // always returning a valid NodesRef object
```

## Notices

### Do not use special characters other than numbers, letters, hyphens, and underscores in the id

Special characters may be parsed as part of a CSS selector or combinator.

For example, `selectAll('#m.x')` will be parsed as looking for elements with both `id=m` and `class=x` attributes, rather than looking for an element with `id` as `m.x`.

## Compatibility

**Compatibility Table**

**Query:** `lynx-api.selector-query.selectAll`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/lynx-api/selector-query/selectAll.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| selectAll | Yes (2.8) | Yes (3.4) | Yes (2.8) | Yes (3.7) | Yes (3.7) | Yes |

**`selectAll`**

Select all nodes that match the specified CSS selector under the root node specified by `SelectorQuery`.

