HTML DOM fullscreenEnabled() Method (original) (raw)

Last Updated : 11 Jul, 2025

The fullscreenEnabled() method in HTML DOM is used to check whether the document can be viewed in full-screen mode or not. It returns a single read-only Boolean value. This method may require specific prefixes to work with different browsers.

**Syntax:

document.fullscreenEnabled()

**Parameters: This method does not accept any parameters.

**Return Value: It returns a boolean value:

**Example 1:

html `

HTML DOM fullscreenEnabled() method
<!-- script to check full screen enabled or not -->
<script>
    function requestFullScreen() {
        let isFullscreenSupported =

            /* Standard syntax */
            (document.fullscreenEnabled ||

                /* Chrome, Safari and Opera */
                document.webkitFullscreenEnabled ||

                /* Firefox */
                document.mozFullScreenEnabled ||

                /* IE/Edge */
                document.msFullscreenEnabled);

        document.querySelector('.isSupported').innerHTML
            = isFullscreenSupported;
    }
</script>

GeeksforGeeks

<h2>
    fullscreenEnabled() method
</h2>

<!-- script called here -->
<button onclick="requestFullScreen();">
    Check fullscreen supported
</button>

<p>Fullscreen support:</p>

<div class="isSupported"></div>

`

**Output: check_fullscreen_output

**Example 2:

html `

HTML DOM fullscreenEnabled() method
<!-- script to enable full screen -->
<script>
    function goFullScreen() {
        if (

            /* Standard syntax */
            document.fullscreenEnabled ||

            /* Chrome, Safari and Opera */
            document.webkitFullscreenEnabled ||

            /* Firefox */
            document.mozFullScreenEnabled ||

            /* IE/Edge */
            document.msFullscreenEnabled
        ) {
            elem = document.querySelector('#image');
            elem.requestFullscreen();
        }
        else {
            console.log('Fullscreen not enabled')
        }
    }
</script>

GeeksforGeeks

<h2>
    HTML DOM fullscreenEnabled() method
</h2>

<img id="image" src=

"https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-logo.png" />

<button onclick="goFullScreen();">
    Fullscreen
</button>

`

**Output:

go-fullscreen-output **Supported Browsers: The browser supported by _fullscreenEnabled() method are listed below: