Document: exitPointerLock() method

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The exitPointerLock() method of the Document interface asynchronously releases a pointer lock previously requested through Element.requestPointerLock.

Note: While the exitPointerLock() method is called on the document, the requestPointerLock() method is called on an element.

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

Syntax

js
exitPointerLock()

Parameters

None.

Return value

None (undefined).

Specifications

Specification
Pointer Lock 2.0
# dom-document-exitpointerlock

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
exitPointerLock
Chrome – Full support
Chrome 22 (Release date: 2012-09-25)
prefix
prefix Implemented with the vendor prefix: webkit
Chrome – Full support
Chrome 37 (Release date: 2014-08-26)
footnote Full support
Edge – Full support
Edge 13 (Release date: 2015-11-12)
footnote Full support
Firefox – No support
Firefox 14 – 49 (Release date: 2012-07-17)
prefix
prefix Implemented with the vendor prefix: moz
Firefox – Full support
Firefox 50 (Release date: 2016-11-15)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
prefix
prefix Implemented with the vendor prefix: webkit
Opera – Full support
Opera 24 (Release date: 2014-09-02)
footnote Full support
Safari – Full support
Safari 10.1 (Release date: 2017-03-27)
footnote Full support
Chrome Android – No support
Chrome Android
footnote
footnote See bug 40290045
Firefox for Android – No support
Firefox for Android 14 – 49 (Release date: 2012-06-26)
prefix
prefix Implemented with the vendor prefix: moz
Firefox for Android – Full support
Firefox for Android 50 (Release date: 2016-11-15)
footnote Full support
Opera Android – No support
Opera Android
footnote
footnote See bug 40290045
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote
footnote See bug 40290045
WebView Android – No support
WebView Android
footnote
footnote See bug 40290045
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.
Requires a vendor prefix or different name for use.
Has more compatibility info.

See also