Web/API/DocumentOrShadowRoot/pointerLockElement

From Get docs


The pointerLockElement property of the Document and ShadowRoot interfaces 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 document.

Syntax

var element = document.pointerLockElement;

Return value

An Element or null.

Specifications

Specification Status Comment
Pointer LockThe definition of 'pointerLockElement' in that specification. Candidate Recommendation Extend the Document interface

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet

pointerLockElement

Experimental'

Chrome

Full support 53

Edge

Full support 12

Firefox

Full support 63

IE

Full support Yes

Opera

Full support 40

Safari

Full support Yes

WebView Android

Full support 53

Chrome Android

Full support 53

Firefox Android

Full support 63

Opera Android

Full support 41

Safari iOS

Full support Yes

Samsung Internet Android

Full support 6.0

Legend

Full support  
Full support
Experimental. Expect behavior to change in the future.'
Experimental. Expect behavior to change in the future.


See also