This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

fullscreenElement

Summary

Exposes the current fullscreen state, returning the element that is displayed fullscreen, or null if there is no such element.

Property of dom/Documentdom/Document

Syntax

Note: This property is read-only.

var element = document.fullscreenElement;

Return Value

Returns an object of type ElementElement

Returns the element that is displayed fullscreen, or null if there is no such element.

Examples

function inFullScreen() {
  if (document.fullscreenElement == null) {
    // no element is in full-screen mode
    return false;
  }
  else {
    // an element is in full-screen mode
    return true;
  }
}

Related specifications

W3C Fullscreen
Working Draft

Related specifications

W3C fullscreen working draft

See also

Tutorial: Using the full-screen API