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

# lynx: querySelectorAll(selector: string)

APISummary
在页面的子元件中查找所有满足指定选择器的元件。

## 语法

```ts
const elementArray = lynx.querySelectorAll(selector);
```

### 参数

#### selector

指定选择器，支持的选择器列表见 [selector](/next/zh/api/lynx-api/selector-query/selector-query-select.md#selector)。

### 返回值

[`MainThread.Element[]`](/next/zh/api/lynx-api/main-thread/main-thread-element.md) 或 `[]`。

## 兼容性

**Compatibility Table**

**Query:** `lynx-api.lynx.querySelectorAll`

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

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| querySelectorAll | Yes (2.14) | Yes (3.4) | Yes (2.14) | Yes (3.5) | Yes (3.5) | Yes |

**`querySelectorAll`**

**Status:** Experimental

**Specifications:**

- **Web — Supported (version unknown):** Implemented since `@lynx-js/web-core@0.20.0` (lynx-family/lynx-stack#2382).

