Document.fullscreen is a deprecated instance property that returns true or false for fullscreen mode. Learn the no-op setter quirk, why fullscreenElement is better, how it fits the Fullscreen API, and five examples with try-it labs.
01
Kind
Read-only property
02
Type
boolean
03
Status
Deprecated
04
Means
Fullscreen on?
05
Replace
fullscreenElement
06
Setter
No-op ignored
Fundamentals
Introduction
The Fullscreen API lets a page expand a video, game canvas, or gallery to fill the screen. Scripts often need a simple yes/no answer: “Are we in fullscreen right now?”
Historically, that answer was document.fullscreen. MDN now calls it obsolete and recommends checking Document.fullscreenElement instead—if it is not null, fullscreen mode is active.
💡
Boolean vs Element
fullscreen only says yes/no. fullscreenElement also tells you which element is fullscreen—more useful for UI state.
If fullscreenElement isn’t null, fullscreen mode is in effect (MDN).
📈 No-op Setter, Toggle & Events
See the ignored assignment, then control fullscreen with the modern API.
Example 3 — Assigning Does Not Throw (MDN)
The setter is a no-operation and is ignored—even in strict mode.
JavaScript
"use strict";
const before = document.fullscreen;
document.fullscreen = true; // ignored — does not enter fullscreen
const after = document.fullscreen;
console.log({ before, after, changed: before !== after });
Document.fullscreen is deprecated on MDN. Prefer fullscreenElement for new checks. Logos use the shared browser-image-sprite.png sprite from this project.
✓ Deprecated · Prefer fullscreenElement
Document.fullscreen
Obsolete Boolean fullscreen flag — use document.fullscreenElement !== null instead.
LegacyCompatibility only
Google ChromeMay still expose · prefer Element API
Legacy / limited
Mozilla FirefoxLegacy support · prefer alternatives
Legacy / limited
Apple SafariDo not rely on deprecated Boolean
Legacy / limited
Microsoft EdgeChromium · avoid new use
Legacy / limited
OperaFollow Chromium deprecation path
Legacy / limited
Internet ExplorerHistorical / prefixed Fullscreen paths
Legacy support
Document.fullscreenAvoid in new code
Bottom line: Recognize document.fullscreen in old scripts. For new work, detect with fullscreenElement and control fullscreen via requestFullscreen / exitFullscreen.
Wrap Up
Conclusion
Document.fullscreen is a deprecated yes/no flag for fullscreen mode. Learn it to maintain old code—then migrate checks to document.fullscreenElement !== null and control fullscreen with the modern Fullscreen API.
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 to it 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 first when needed.
No. Learn it only to read legacy code. New checks should use fullscreenElement.
Did you know?
The Fullscreen Standard still mentions document.fullscreen as a historical attribute and tells authors to use fullscreenElement instead. The Boolean remains mainly for compatibility with older pages—not as the API you should design around.