Window screenY attribute

Definition and Usage

screenY The attribute returns the y (vertical) coordinate of the window relative to the screen.

See also:

screenX attribute

screenLeft attribute

screenTop attribute

Example

Example 1

Open a new window with specified left and top positions and return its coordinates:

const myWin = window.open("", "", "left=700,top=350,width=200,height=100");
let x = myWin.screenX;
let y = myWin.screenY;

Try it yourself

Example 2

Open a new window and return its coordinates:

const myWin = window.open("", "", "width=200,height=100");
let x = myWin.screenX;
let y = myWin.screenY;

Try it yourself

Syntax

window.screenY

or:

screenY

Parameter

None.

Return Value

Type Description
Number The vertical distance of the window from the screen in pixels.

Browser Support

All Browsers Support window.screenY:

Chrome IE Edge Firefox Safari Opera
Chrome IE Edge Firefox Safari Opera
Support 10-11 Support Support Support Support