← Back to CSS domain
CSS.getComputedStyleForNode
Returns the computed style for a DOM node identified by `nodeId`.
Domain: CSS
experimental
Parameters
| Name | Type | Description |
nodeId | DOM.NodeId | |
Returns
| Name | Type | Description |
computedStyle | array | Computed style for the specified DOM node. |
extraFields | ComputedStyleExtraFields | A list of non-standard "extra fields" which blink stores alongside each
computed style. |
Example Request
{
"id": 1,
"method": "CSS.getComputedStyleForNode",
"params": {
"nodeId": 1
}
}
Example Response
{
"id": 1,
"result": {
"computedStyle": [],
"extraFields": "extraFields-value"
}
}
Usage in Node.js
const result = await send('CSS.getComputedStyleForNode', {"nodeId": 1});
console.log(result);
// {"computedStyle": [], "extraFields": "extraFields-value"}