DocumentOrShadowRoot.fullscreenElement

The DocumentOrShadowRoot.fullscreenElement read-only property returns the Element that is currently being presented in full-screen mode in this document, or null if full-screen mode is not currently in use.

Although this property is read-only, it will not throw if it is modified (even in strict mode); the setter is a no-operation and it will be ignored.

Syntax

var element = document.fullscreenElement;

Return value

The Element object that's currently in full-screen mode; if full-screen mode isn't currently in use by the document>, the returned value is null.

Example

This example presents a function, isVideoInFullscreen(), which looks at the value returned by fullscreenElement; if the document is in full-screen mode (fullscreenElement isn't null) and the full-screen element's nodeName is VIDEO, indicating a <video> element, the function returns true, indicating that the video is in full-screen mode.

function isVideoInFullscreen() {
  if (document.fullscreenElement && document.fullscreenElement.nodeName == 'VIDEO') {
    return true;
  }
  return false;
}

Specifications

Specification Status Comment
Fullscreen API
The definition of 'Document.fullscreenElement' in that specification.
Living Standard Initial definition

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
fullscreenElementChrome Full support 53
Prefixed
Full support 53
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support ≤18
Prefixed
Full support ≤18
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Full support 12
Prefixed
Prefixed Implemented with the vendor prefix: ms
Firefox Full support 64
Full support 64
No support 47 — 65
Disabled
Disabled From version 47 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No support 9 — 65
Alternate Name
Alternate Name Uses the non-standard name: mozFullScreenElement
IE Full support Yes
Prefixed
Full support Yes
Prefixed
Prefixed Implemented with the vendor prefix: ms
Opera Full support 40
Prefixed
Full support 40
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari Full support Yes
Prefixed
Full support Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
WebView Android Full support 53
Prefixed
Full support 53
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android Full support 53
Prefixed
Full support 53
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android Full support 64
Full support 64
No support 47 — 65
Disabled
Disabled From version 47 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No support 9 — 65
Alternate Name
Alternate Name Uses the non-standard name: mozFullScreenElement
Opera Android Full support 41
Prefixed
Full support 41
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari iOS Partial support 12
Notes Alternate Name
Partial support 12
Notes Alternate Name
Notes Full-screen mode is only supported on the iPad.
Alternate Name Uses the non-standard name: webkitFullscreenElement
Samsung Internet Android Full support 6.0
Prefixed
Full support 6.0
Prefixed
Prefixed Implemented with the vendor prefix: webkit

Legend

Full support
Full support
Partial support
Partial support
See implementation notes.
See implementation notes.
User must explicitly enable this feature.
User must explicitly enable this feature.
Uses a non-standard name.
Uses a non-standard name.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

See also