DocumentOrShadowRoot.pointerLockElement

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 Lock
The definition of 'pointerLockElement' in that specification.
Candidate Recommendation Extend the Document interface

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
pointerLockElement
Experimental
Chrome Full support 53Edge Full support 12Firefox Full support 63IE Full support YesOpera Full support 40Safari Full support YesWebView Android Full support 53Chrome Android Full support 53Firefox Android Full support 63Opera Android Full support 41Safari iOS Full support YesSamsung 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