SVG window.menubar Property
The SVG window.menubar property returns the menubar object through which we can check the visibility.
Syntax:
var mb = window.menubar
Return value: This property returns the menubar object.
Example 1:
HTML
<!DOCTYPE html>
< html >
< body >
< center >
< h1 >GeeksforGeeks</ h1 >
< button onclick = "get()" >
Click Here
</ button >
< svg viewBox = "0 0 10000 10000"
< script type = "text/javascript" >
function get() {
var g = document.getElementById("g");
console.log(window.menubar);
}
</ 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"
< script type = "text/javascript" >
function get() {
var g = document.getElementById("g");
g.innerHTML = "Is it visible? : "
+ window.menubar.visible;
}
</ script >
</ svg >
</ center >
</ body >
</ html >
|
Output:
Supported Browsers:
- Google Chrome
- Edge
- Firefox
- Safari
- Opera
- Internet Explorer
Last Updated :
30 Mar, 2022
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...