Open In App

HTML DOM Window screenY Property

Last Updated : 15 Jun, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The Window screenY property is used for returning the ‘y’ or the vertical coordinates of a window relative to the screen. It returns a number which represents the vertical distance of a window relative to the screen in pixels. 

Syntax:

window.screenY

Below program illustrates the window.screenY property : 

Checking the Y coordinates of a window relative to the screen. 

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>
      Window screenY Property in HTML
    </title>
    <style>
        h1 {
            color: green;
        }
          
        h2 {
            font-family: Impact;
        }
          
        body {
            text-align: center;
        }
    </style>
</head>
  
<body>
  
    <h1>GeeksforGeeks</h1>
    <h2>Window screenY  Property</h2>
  
    <p>
      For returning the Y coordinates of a window 
      relative to the screen, double click the "Check 
      Y Coordinate" button: 
    </p>
  
    <button ondblclick="coordinate()">
      Check Y Coordinate
    </button>
  
    <script>
        function coordinate() {
            var Y = window.open("", "myWindow");
            Y.document.write
                    ("<p>Welcome to my Window");
            Y.document.write
            ("<br>Y Coordinate : " + Y.screenY + "</p>");
        }
    </script>
  
</body>
  
</html>                   


Output:

  

After clicking the button

  

Supported Browsers: The browser supported by Window screenY Property are listed below:

  • Google Chrome 1 and above
  • Edge 12 and above
  • Firefox 1 and above
  • Internet Explorer 9 and above
  • Opera 12.1 and above
  • Safari 1 and above


Similar Reads

HTML | DOM MouseEvent screenY Property
The MouseEvent screenY property is a read-only property and used for returning the vertical coordinate of the mouse pointer when an event was triggered. Syntax : event.screenY Return Value: It returns a number which represents the vertical coordinate of the mouse pointer in pixels. Below program illustrates the MouseEvent screenY property: Example:
1 min read
Difference between window.location.href, window.location.replace and window.location.assign in JavaScript
Window.location is a property that returns a Location object with information about the document's current location. This Location object represents the location (URL) of the object it is linked to i.e. holds all the information about the current document location (host, href, port, protocol, etc.) All three commands are used to redirect the page t
4 min read
Web Window API | DOM Window fullscreen property
The Window interface has a fullscreen property which tells whether the window is displayed in fullscreen mode or not. Syntax: BoolVal = windowReference.fullScreen; Return value: Boolean True: If windows is in fullscreen mode. False: If windows are not in fullscreen mode. Example : &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt; Window
1 min read
Web Window API | Window locationbar property
In Web API Window.locationbar property returns the object of locationbar, for which we can check the visibility. Syntax: objectReference = window.locationbar Example: Check the visibility. &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt; Window locationbar property &lt;/title&gt; &lt;style&gt; a:focus { background-color: magenta; }
1 min read
Web Window API | Window scrollbars property
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 &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt; Window scrollbars property &lt;/title&gt; &lt;style&gt; a:focus { background-color: magenta; } &lt;/st
1 min read
Web Window API | Window personalbar property
In Web API Window.personalbar property returns the object of personalbar, for which we can check the visibility. Syntax: objectReference = window.personalbar Example: Check the visibility &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt; Window personalbar property &lt;/title&gt; &lt;script type=&quot;text/javascript&quot;&gt; function
1 min read
Web Window API | Window statusbar property
In Web API Window.statusbar property returns the object of statusbar, for which we can check the visibility. Syntax: objectReference = window.statusbar Example: Check the visibility &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt; Window statusbar property &lt;/title&gt; &lt;script type=&quot;text/javascript&quot;&gt; function getvisib
1 min read
Web Window API | Window toolbar property
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 C/C++ Code &amp;lt;!DOCTYPE html&amp;gt; &amp;lt;html&amp;gt; &amp;lt;head&amp;gt; &amp;lt;title&amp;gt; Window toolbar property &amp;lt;/title&amp;gt; &amp;lt;script type=&amp;
1 min read
Web Window API | Window menubar property
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. C/C++ Code &amp;lt;!DOCTYPE html&amp;gt; &amp;lt;html&amp;gt; &amp;lt;head&amp;gt; &amp;lt;title&amp;gt; Window m
1 min read
HTML DOM Window top( ) Property
The Window top() property is used to return the topmost browser window of a current window. It is a read-only property and it returns a reference to the topmost window in the window hierarchy.Syntax: window.top Return Value: It returns the reference of the topmost window in the window hierarchy. Below program illustrates the Window top() property :
2 min read