The read-only pointerLockElement
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.
The read-only pointerLockElement
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.
An Element
or null
.
js
let customElem = document.querySelector("my-shadow-dom-element"); let shadow = customElem.shadowRoot; let pleElem = shadow.pointerLockElement;
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
pointerLockElement |
53 | 79 | 63 | No | 40 | 10.1 | 53 | 53 | 63 | 41 | No | 6.0 |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/pointerLockElement