Open In App

Web Window API | DOM Window fullscreen property

Last Updated : 31 Jul, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
The Window interface has a fullscreen property which tells whether the window is displayed in fullscreen mode or not. Syntax:
BoolVal = windowReference.fullScreen;
Return value:
    Boolean
    • True: If windows is in fullscreen mode.
    • False: If windows are not in fullscreen mode.
Example : html
<!DOCTYPE html>
<html>

<head>
    <title>
        Window fullscreen property
    </title>
</head>

<body>
    <center>
        <h1 style="color:green;"> 
                GeeksForGeeks 
            </h1>

        <h2>Window fullscreen property</h2>

        <button onclick="GFGfun();">press</button>
        <script>
            function GFGfun() {
                alert(window.fullScreen);
            }
        </script>
    </center>
</body>

</html>
Output: Window not in fullscreen: Window in fullscreen: Browser support:
  • Firefox 3+

Next Article

Similar Reads