← Back to DOM domain
DOM.getAttributes
Returns attributes for the specified node.
Domain: DOM
stable
Parameters
| Name | Type | Description |
nodeId | NodeId | Id of the node to retrieve attributes for. |
Returns
| Name | Type | Description |
attributes | array | An interleaved array of node attribute names and values. |
Example Request
{
"id": 1,
"method": "DOM.getAttributes",
"params": {
"nodeId": 1
}
}
Example Response
{
"id": 1,
"result": {
"attributes": [
"class",
"container",
"id",
"main"
]
}
}
Usage in Node.js
const result = await send('DOM.getAttributes', {"nodeId": 1});
console.log(result);
// {"attributes": ["class", "container", "id", "main"]}