← Back to DOM domain
DOM.querySelectorAll
Executes `querySelectorAll` on a given node.
Domain: DOM
stable
Parameters
| Name | Type | Description |
nodeId | NodeId | Id of the node to query upon. |
selector | string | Selector string. |
Returns
| Name | Type | Description |
nodeIds | array | Query selector result. |
Example Request
{
"id": 1,
"method": "DOM.querySelectorAll",
"params": {
"nodeId": 1,
"selector": "h1"
}
}
Example Response
{
"id": 1,
"result": {
"nodeIds": [
3,
4,
5
]
}
}
Usage in Node.js
const result = await send('DOM.querySelectorAll', {"nodeId": 1, "selector": "h1"});
console.log(result);
// {"nodeIds": [3, 4, 5]}