Open In App

SVG window.toolbar Property

Last Updated : 23 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The SVG window.toolbar property returns the toolbar object through which we can check the visibility.

Syntax:

var tb = window.toolbar

Return value: This property returns the toolbar object

Example 1: 

HTML
<!DOCTYPE html>
<html>

<body>
    <center>
        <h1>GeeksforGeeks</h1>

        <button onclick="get()">
            Click Here
        </button>
        
        <svg viewBox="0 0 10000 10000" 
            xmlns="https://www.w3.org/2000/svg">
            
            <script type="text/javascript">
                function get() {
                    var g = document.getElementById("g");
                    console.log(window.toolbar);
                }
            </script>
        </svg>
    </center>
</body>

</html>

Output:

Example 2: 

HTML
<!DOCTYPE html>
<html>

<body>
    <center>
        <h1>GeeksforGeeks</h1>

        <button onclick="get()">
            Click Here
        </button>
        
        <div id="g"></div>
        
        <svg viewBox="0 0 1000 1000" 
            xmlns="https://www.w3.org/2000/svg">
            
            <script type="text/javascript">
                function get() {
                    var g = document.getElementById("g");
                    g.innerHTML = "Is it visible? : " +
                        window.toolbar.visible;
                }
            </script>
        </svg>
    </center>
</body>

</html>

Output:

Supported Browsers:

  • Google Chrome
  • Edge
  • Firefox
  • Safari
  • Opera
  • Internet Explorer

Similar Reads