← Back to DOM domain

DOM.setOuterHTML

Sets node HTML markup, returns new node id.

Domain: DOM stable

Parameters

NameTypeDescription
nodeIdNodeIdId of the node to set markup for.
outerHTMLstringOuter HTML markup to set.

Example Request

{
  "id": 1,
  "method": "DOM.setOuterHTML",
  "params": {
    "nodeId": 1,
    "outerHTML": "<div>Modified</div>"
  }
}

Example Response

{
  "id": 1,
  "result": {}
}

Usage in Node.js

const result = await send('DOM.setOuterHTML', {"nodeId": 1, "outerHTML": "
Modified
"}); console.log(result);