DocumentOrShadowRoot.fullscreenElement

The Document.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

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 53
Prefixed
Full support 53
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support Yes
Prefixed
Full support Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Full support 64
Full support 64
Full support 47
Disabled
Disabled From version 47: 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.
Full support 9
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
Edge Mobile Full support Yes
Prefixed
Full support Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android Full support 64
Full support 64
Full support 47
Disabled
Disabled From version 47: 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.
Full support 9
Alternate Name
Alternate Name Uses the non-standard name: mozFullScreenElement
Opera Android Full support 40
Prefixed
Full support 40
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari iOS Full support Yes
Prefixed
Full support Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
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
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