Open In App

Web Window API | Window menubar property

Last Updated : 06 Aug, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

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

Syntax:

objectReference = window.menubar

Example: This example uses Window.menubar property to check the visibility of menubar object. 

html




<!DOCTYPE html>
<html>
 
<head>
 
    <title>
        Window menubar property
    </title>
 
    <script type="text/javascript">
        function getvisibility() {
 
            document.getElementById(
                    'visibility').innerHTML =
                window.menubar.visible;
 
        }
    </script>
 
</head>
 
<body>
    <center>
 
        <h1 style="color:green;"> 
                GeeksForGeeks 
            </h1>
 
        <h2>Window menubar 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: The browsers supported by Window.menubar property are listed below:

  • 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


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads