Element.requestPointerLock()

Experimental

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
Unknown
The definition of 'requestPointerLock()' in that specification.
Candidate Recommendation

Browser compatibility

BCD tables only load in the browser

See also