← Back to DOM domain
DOM.getOuterHTML
Returns node's HTML markup.
Domain: DOM
stable
Parameters
| Name | Type | Description |
nodeId (optional) | NodeId | Identifier of the node. |
backendNodeId (optional) | BackendNodeId | Identifier of the backend node. |
objectId (optional) | Runtime.RemoteObjectId | JavaScript object id of the node wrapper. |
includeShadowDOM (optional) | boolean | Include all shadow roots. Equals to false if not specified. |
Returns
| Name | Type | Description |
outerHTML | string | Outer HTML markup. |
Example Request
{
"id": 1,
"method": "DOM.getOuterHTML"
}
Example Response
{
"id": 1,
"result": {
"outerHTML": "<h1>Example Domain</h1>"
}
}
Usage in Node.js
const result = await send('DOM.getOuterHTML');
console.log(result);
// {"outerHTML": "Example Domain
"}