← Back to DOM domain

DOM.focus

Focuses the given element.

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.

Example Request

{
  "id": 1,
  "method": "DOM.focus"
}

Example Response

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

Usage in Node.js

const result = await send('DOM.focus');
console.log(result);