JavaScript Document fullscreen Property

Beginner
5 min read
Updated: Nov 2026
3 examples
Property

Definition

Document.fullscreen is a deprecated read-only Boolean that is true when the document is showing content in fullscreen mode, otherwise false (MDN).

Read the notes below before you get or set this property. Prefer feature detection when support is limited.

Syntax

Use document.fullscreen. Start with this line.

JavaScript
document.fullscreen
CallWhat it does
document.fullscreenPrimary signature.

Built into the browser. Read or assign document.fullscreen — no import required.

Library declarations
JavaScript
document.fullscreen

Parameters

ParameterDescription
fullscreenEnabledOptional. Whether the Fullscreen API is allowed

Return Value

Return ValueDescription
*Boolean (true / false)

JavaScript Examples

Example 1 — Legacy document.fullscreen

MDN-style helper using the obsolete Boolean property.

JavaScript
function isDocumentInFullScreenMode() {
  return document.fullscreen;
}

console.log(isDocumentInFullScreenMode());  // false (usually)
Try It Yourself

How It Works

  1. Read the Boolean. document.fullscreen is true only while fullscreen is active.
  2. Wrap it in a helper. Same idea as MDN’s isDocumentInFullScreenMode.
  3. Expect false here. A normal tutorial page is not in fullscreen.
  4. Remember the status. This API is deprecated — keep it for reading old code.

Example 2 — Prefer fullscreenElement

MDN’s recommended replacement for the same question.

JavaScript
function isDocumentInFullScreenMode() {
  return document.fullscreenElement !== null;
}

console.log(isDocumentInFullScreenMode());  // false (usually)
console.log(document.fullscreenElement);    // null
Try It Yourself

How It Works

  1. Ask for the element. fullscreenElement is the node in fullscreen, or null.
  2. Convert to Boolean. !== null answers “is fullscreen active?”
  3. Bonus detail. When active, you also know which element is fullscreen.
  4. Use this in new code. Same intent as document.fullscreen, without the deprecated API.

Example 3 — Compare Both + No-op Assign

See that both checks agree, and that assigning to fullscreen is ignored.

JavaScript
const legacy = !!document.fullscreen;
const modern = document.fullscreenElement !== null;

console.log(legacy);   // false (usually)
console.log(modern);   // false (usually)
console.log(legacy === modern);  // true

document.fullscreen = true;  // ignored — no throw
console.log(document.fullscreen);  // still false
Try It Yourself

How It Works

  1. Normalize legacy. !!document.fullscreen makes a clear Boolean.
  2. Compute modern. fullscreenElement !== null is the replacement check.
  3. They should match. Both report the same active/inactive state.
  4. Assign does nothing. MDN: the setter is a no-op and does not throw.

Browser Support

Document.fullscreen is Deprecated (MDN). Many engines still expose it for compatibility, but new projects should use document.fullscreenElement.

✓ Deprecated · Prefer fullscreenElement

Document.fullscreen

Obsolete Boolean fullscreen flag — still readable in many browsers for legacy scripts; replace with fullscreenElement !== null.

Legacy Deprecated API
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
document.fullscreen Deprecated

Bottom line: Safe to recognize in old code. For new work, check document.fullscreenElement, enter with element.requestFullscreen(), and exit with document.exitFullscreen().

Frequently Asked Questions

A Boolean that is true if the document is currently displaying an element in fullscreen mode; otherwise false (MDN).
Yes. MDN marks Document.fullscreen as Deprecated (obsolete). Prefer checking document.fullscreenElement !== null in new code.
Use Document.fullscreenElement. If it is not null, fullscreen mode is active and that Element is the one being presented (MDN).
The property is read-only, but assigning does not throw — even in strict mode. The setter is a no-operation and is ignored (MDN).
Call element.requestFullscreen() to enter and document.exitFullscreen() to leave. Check document.fullscreenEnabled when you need to know if the API is allowed.
No. Learn it to read legacy code. New checks should use fullscreenElement !== null.

Next: fullscreenElement

Learn the modern property that replaces document.fullscreen.

fullscreenElement tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful