ShadowRoot: pointerLockElement property

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

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

Specifications

Specification
Pointer Lock 2.0
# dom-documentorshadowroot-pointerlockelement

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
pointerLockElement

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

See also