Window screenTop

Example

Return the x and y coordinates of the window:

let x = window.screenLeft;
let y = window.screenTop;
Try it Yourself »

Description

The screenTop property returns the y (vertical) position of the window relative to the screen.


Syntax

window.screenTop

Return Value

Type Description
A numberThe y (vertical) position of the window relative to the screen, in pixels.

Browser Support

window.screenTop is supported in all modern browsers:

Chrome Edge Firefox Safari Opera IE
Yes Yes Yes Yes Yes 11

window.screenLeft was not supported in Firefox before version 64 (Nov 2018).


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.