Web Window API | Window toolbar property

Last Updated : 12 Jul, 2022

In HTML Window.toolbar property returns the object of toolbar, for which we can check the visibility

Syntax:

objectReference = window.toolbar

Example: Check the visibility 

html
<!DOCTYPE html>
<html>

<head>

    <title>
        Window toolbar property
    </title>

    <script type="text/javascript">
        function getvisibility() {

            document.getElementById(
                    'visibility').innerHTML =
                window.toolbar.visible;

        }
    </script>

</head>

<body>
    <center>

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

        <h2>Window toolbar property</h2>
        <button onclick="getvisibility ();"
                id="btn">
          Check visibility
      </button>
        <p id='visibility'></p>
    </center>
</body>

</html>

Output: 

Click the button:

  

When the button is clicked:

  

Supported Browsers:

  • Google Chrome 1 and above
  • Edge 12 and above
  • Firefox 1 and above
  • Safari 3 and above
  • Opera 15 and above
  • Internet Explorer not supported
Comment