MDN self-hosted library · e01.org

ShadowRoot: pointerLockElement property

Pointer Lock API

Open notebook · 1 cells web-api-instance-property upstream source

Pointer Lock API

The pointerLockElement read-only property of the ShadowRoot interface provides the element set as the target for mouse events while the pointer is locked. It is null if lock is pending, pointer is unlocked, or the target is in another tree.

Value

An Element or null.

Examples

let customElem = document.querySelector("my-shadow-dom-element");
let shadow = customElem.shadowRoot;
let pleElem = shadow.pointerLockElement;

Specifications

Browser compatibility

See also

  • Document.exitPointerLock()
  • Element.requestPointerLock()
  • Pointer Lock