The fullscreenchange event fires right after an element enters or leaves fullscreen. Learn document.fullscreenElement, requestFullscreen / exitFullscreen, onfullscreenchange, error handling, and five try-it labs.
01
Kind
Instance event
02
Type
Event
03
When
Enter or exit fullscreen
04
Handler
onfullscreenchange
05
Check state
document.fullscreenElement
06
Status
Limited availability
Fundamentals
Introduction
Games, video players, and slideshows often need the whole screen. The Fullscreen API lets an element go fullscreen with requestFullscreen(), and leave with document.exitFullscreen().
fullscreenchange is the signal that the transition already happened. Update button labels, CSS classes, or analytics in that handler. MDN marks it as Limited availability (not Baseline)—feature-detect and test.
💡
Beginner tip
Entering fullscreen usually requires a user gesture (click / key). Calling requestFullscreen() from a random timer often fails and may fire fullscreenerror instead.
Concept
Understanding fullscreenchange
An instance event that answers: “Did this element just enter or leave fullscreen?”
Fires immediately after the element switches into or out of fullscreen.
Does not encode enter vs exit — read document.fullscreenElement.
Bubbles toward the document (you can also listen on document).
Event type — a plain Event.
Handler — onfullscreenchange or addEventListener("fullscreenchange", ...).
Limited availability on MDN (not Baseline)—test carefully.
Foundation
📝 Syntax
Use the event name with addEventListener, or set the handler property:
fullscreenchange is marked Limited availability on MDN (not Baseline). Logos use the shared browser-image-sprite.png sprite from this project. Feature-detect requestFullscreen / exitFullscreen, and remember iframes and permissions can still block fullscreen.
✓ Limited availability
Element fullscreenchange
Fullscreen enter/exit signal; confirm support and permissions in your target browsers.
LimitedNot Baseline
Google ChromeSupported (check BCD / iframe policy)
Supported
Mozilla FirefoxSupported in modern versions
Supported
Apple SafariSupported with platform quirks
Supported
Microsoft EdgeSupported · Chromium
Supported
OperaSupported · Modern versions
Supported
Internet ExplorerNo modern Fullscreen API
No
fullscreenchangeLimited
Bottom line: Listen for fullscreenchange, check document.fullscreenElement, and handle fullscreenerror.
Wrap Up
Conclusion
fullscreenchange tells you fullscreen mode already flipped. Drive your UI from document.fullscreenElement, enter with requestFullscreen() after a user gesture, and exit with document.exitFullscreen().
Feature-detect before showing a fullscreen control
❌ Don’t
Assume the event object itself says enter vs exit
Call exitFullscreen on the element (it is on document)
Expect fullscreen to work in every iframe without permissions
Assume Baseline Widely available status
Overwrite onfullscreenchange if you need multiple listeners
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about fullscreenchange
Mode already changed—check fullscreenElement; pair with request/exit.
5
Core concepts
📺01
After toggle
enter or exit
Trigger
📄02
Event
plain Event
API
🔍03
fullscreenElement
null = exited
State
🖱️04
User gesture
to enter
Rule
🎯05
Limited avail.
not Baseline
Status
❓ Frequently Asked Questions
It fires on an Element immediately after that element enters or leaves fullscreen mode. The event itself does not say enter vs exit — check document.fullscreenElement in the handler.
No. MDN does not mark it Deprecated, Experimental, or Non-standard. It has Limited availability (not Baseline), so always test the browsers you care about.
After the event fires, if document.fullscreenElement is non-null, an element is in fullscreen (usually that element). If it is null, fullscreen mode was canceled / exited.
A generic Event (inherits from Event). There is no special FullscreenEvent type for this signal.
Call element.requestFullscreen() to enter (usually from a user gesture). Call document.exitFullscreen() to exit. Listen for fullscreenchange to update your UI.
Listen for the fullscreenerror event on the element. Failures often happen without a user gesture, in unsupported browsers, or when the browser denies permission.
Did you know?
Pressing Esc exits fullscreen without your button code—but fullscreenchange still fires. That is why UI sync should live in the event handler, not only next to requestFullscreen().