--- title: Document.pointerLockElement slug: Web/API/Document/pointerLockElement translation_of: Web/API/DocumentOrShadowRoot/pointerLockElement original_slug: Web/API/DocumentOrShadowRoot/pointerLockElement ---
pointerLockElement 特性规定了如在鼠标事件中当目标被锁定时的元素集和。如果指针处于锁定等待中、指针没有被锁定,或者目标在另外一个文档中这几种情况,返回的值null。
var element = document.pointerLockElement;
An {{domxref("Element")}} or null
.
Specification | Status | Comment |
---|---|---|
{{SpecName('Pointer Lock','l#extensions-to-the-document-interface','Document')}} | {{Spec2('Pointer Lock')}} | Extend the Document interface |
{{ CompatibilityTable() }}
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | {{ CompatVersionUnknown() }} {{property_prefix("webkit")}} | {{CompatVersionUnknown}} | {{ CompatVersionUnknown() }} {{property_prefix("moz")}} | {{ CompatUnknown() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} |
Unprefixed support | {{ CompatVersionUnknown() }} | {{CompatUnknown}} | {{CompatGeckoDesktop(50)}} |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | {{ CompatUnknown() }} | {{CompatVersionUnknown}} | {{ CompatUnknown() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} |