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
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
pointerLockElement | 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.