Skip to content
Related Articles

Related Articles

Improve Article

Web Window API | Window scrollbars property

  • Last Updated : 31 Jul, 2019

In Web APIWindow.scrollbars property returns the object of scrollbars, for which we can check the visibility.

Syntax :

objectReference = window.scrollbars

Example : Check the visibility




<!DOCTYPE html>
<html>
  
<head>
    <title>
        Window scrollbars property
    </title>
  
    <style>
        a:focus {
            background-color: magenta;
        }
    </style>
  
    <script type="text/javascript">
        function getvisibility() {
            document.getElementById('visibility').innerHTML =
              window.scrollbars.visible;
        }
    </script>
  
</head>
  
<body>
    <center>
  
        <h1 style="color:green;">  
                GeeksForGeeks  
            </h1>
  
        <h2>HTML Window scrollbars 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
  • Edge 12
  • Firefox
  • Safari
  • Opera



My Personal Notes arrow_drop_up
Recommended Articles
Page :