English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML DOM fullscreenEnabled attribute

HTML DOM Document Object

fullscreenEnabledA read-only property indicating whether full-screen mode is available.

If full-screen mode can be used, the fullscreenEnabled property returns true; otherwise, it returns false.

Note:This method requires a specific prefix to be used in different browsers (please refer to the browser compatibility below).

Useelement .requestFullscreen()method to view elements in full-screen mode.

Useelement .exitFullscreen()Method to cancel full-screen mode.

Syntax:

document.fullscreenEnabled
function openFullscreen() {
   if (document.fullscreenEnabled) {
   videoElement.requestFullScreen();
   } else {
   console.log('Your browser cannot use fullscreen right now');
   }
}
Test to see‹/›

Browser Compatibility

The numbers in the table specify the first browser version that fully supports the fullscreenEnabled property:

Property
fullscreenEnabled45 -webkit-47 -moz-15 -webkit-5.1 -webkit-12-ms-

Technical Details

Return Value:A boolean value, if it can be called throughelement .requestFullscreen()When the document and its elements are in full-screen modetrue. If full-screen mode cannot be used, this value isfalse.

Related References

DOM ElementsexitFullscreen()Methods

DOM ElementsrequestFullscreen()Methods

HTML DOM Document Object