Nuestros voluntarios aún no han traducido este artículo al Español. ¡Únete a nosotros y ayúdanos a traducirlo!
También puedes leer el artículo en English (US).

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The Element.requestPointerLock() method lets you asynchronously ask for the pointer to be locked on the given element.

To track the success or failure of the request, it is necessary to listen for the pointerlockchange and pointerlockerror events at the Document level.

Syntax

instanceOfElement.requestPointerLock();

Specifications

Specification Status Comment
Pointer Lock
The definition of 'Element' in that specification.
Candidate Recommendation Extend the Element interface

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support Yes
Full support Yes
Full support Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support YesFirefox Full support 50
Full support 50
Full support Yes
Prefixed
Prefixed Implemented with the vendor prefix: moz
IE ? Opera ? Safari ? WebView Android Full support Yes
Full support Yes
Full support Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android ? Edge Mobile Full support YesFirefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

See also

Etiquetas y colaboradores del documento

Colaboradores en esta página: mfluehr, fscholz, erikadoyle, wbamberg, teoli, malrobot, kscarfone, Jeremie
Última actualización por: mfluehr,