Element.requestFullscreen() is an instance method from the Fullscreen API. It asks the browser to display an element in fullscreen mode. Learn the Promise-based flow, user-gesture rules, optional navigationUI settings, and five try-it labs.
01
Kind
Instance method
02
Action
Enter fullscreen
03
Returns
Promise
04
Gesture
User activation
05
Exit
exitFullscreen()
06
Status
Limited availability
Fundamentals
Introduction
Video players, games, slideshows, and image galleries often need a fullscreen view. requestFullscreen() is the standard way to expand a specific element to fill the screen while keeping your page logic in JavaScript.
The call is asynchronous: it returns a Promise that resolves when fullscreen mode is active, or rejects if the browser denies the request. You typically call it from a click handler because MDN requires transient user activation.
💡
Beginner tip
Use document.fullscreenElement to see which element is fullscreen right now. Call document.exitFullscreen() to leave fullscreen mode.
This page is part of JavaScript Element. Related: document.fullscreenElement, document.exitFullscreen(), and the JavaScript hub.
Concept
Understanding the requestFullscreen() Method
Calling el.requestFullscreen() (or el.requestFullscreen(options)) asks the browser to make that element fullscreen. The element must be connected to a document and allowed by the page’s Permissions Policy.
It is an instance method on Element (Fullscreen API).
Returns a Promise that resolves with undefined on success (MDN).
Requires user activation — start from a click or key handler.
Works on standard HTML elements and <svg> (MDN).
Not allowed on <dialog> elements (MDN).
Listen for fullscreenchange to react when mode toggles.
Element.requestFullscreen() is part of the Fullscreen API and is not Baseline on MDN. Desktop browsers generally support it well; mobile Safari has important limitations. Always feature-detect, call from a user gesture, and handle promise rejection.
✓ Limited availability · Not Baseline
Element.requestFullscreen()
Async request to display an element in fullscreen mode.
LimitedNot Baseline
Google ChromeSupported · Desktop & Android
Yes
Microsoft EdgeSupported · Chromium
Yes
Mozilla FirefoxSupported · Desktop
Yes
Apple SafariPartial · iOS limits non-video elements
Limited
OperaSupported · Chromium-based
Yes
Internet ExplorerLegacy vendor-prefixed APIs only
No
requestFullscreen()Limited
Bottom line: Call from a click handler, catch promise errors, listen for fullscreenchange, and test on your target browsers — especially iOS Safari for video vs generic elements.
Wrap Up
Conclusion
Element.requestFullscreen() is the standard way to expand an element to fill the screen. It returns a Promise, needs a user gesture, and pairs with document.fullscreenElement and document.exitFullscreen().
Call requestFullscreen() from a click or key handler
Use .catch() on the returned Promise
Listen for fullscreenchange to sync UI state
Check document.fullscreenElement before toggling
Provide a visible exit control for accessibility
❌ Don’t
Call fullscreen on page load without user activation
Assume mobile Safari behaves like desktop Chrome
Forget iframe allowfullscreen permissions
Ignore promise rejection when permission is denied
Trap users with no way to exit fullscreen
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about Element.requestFullscreen()
Async fullscreen requests from a user gesture—Promise in, events out.
5
Core concepts
📝01
Returns
Promise
API
📄02
Gesture
required
Security
✍️03
Check
fullscreenElement
State
✅04
Status
limited
MDN
⚡05
Exit
exitFullscreen
Pair
❓ Frequently Asked Questions
It issues an asynchronous request to display the element in fullscreen mode (MDN). The method returns a Promise that resolves when the transition completes.
No. MDN does not mark it Deprecated, Experimental, or Non-standard. It is Limited availability (not Baseline) because support varies, especially on mobile.
A Promise that resolves with undefined when fullscreen mode is active, or rejects with an exception if permission is denied or the element is not eligible (MDN).
Yes. MDN: transient user activation is required — call it from a user gesture such as a button click or key press handler.
Standard HTML elements or SVG (MDN). The element must be in a document, not a dialog, and allowed by Permissions Policy. Iframes need the allowfullscreen attribute.
Call document.exitFullscreen() or listen for fullscreenchange and check document.fullscreenElement. Users can also press Esc in most browsers.
Did you know?
The Fullscreen API is separate from CSS :fullscreen styling and PWA display-mode: fullscreen. requestFullscreen() is a runtime JavaScript request on a specific element, usually triggered by a user click.