← Back to DOM domain

DOM.getOuterHTML

Returns node's HTML markup.

Domain: DOM stable

Parameters

NameTypeDescription
nodeId (optional)NodeIdIdentifier of the node.
backendNodeId (optional)BackendNodeIdIdentifier of the backend node.
objectId (optional)Runtime.RemoteObjectIdJavaScript object id of the node wrapper.
includeShadowDOM (optional)booleanInclude all shadow roots. Equals to false if not specified.

Returns

NameTypeDescription
outerHTMLstringOuter 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

"}