X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Window screenLeft and screenTop Properties

Window Object Reference Window Object

Example

Return the x and y coordinates of the new window relative to the screen:

var myWindow = window.open("", "myWin");
myWindow.document.write("<p>This is 'myWin'");
myWindow.document.write("<br>ScreenLeft: " + myWindow.screenLeft);
myWindow.document.write("<br>ScreenTop: " + myWindow.screenTop + "</p>");

Try it yourself »


Definition and Usage

The screenLeft and screenTop properties returns the x (horizontal) and y (vertical) coordinates of the window relative to the screen.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The screenLeft and screenTop properties are supported in all major browsers, except Firefox.

Note: For Firefox, use "window.screenX" and "window.screenY".


Syntax

window.screenLeft
window.screenTop

Technical Details

Return Value: The horizontal and vertical distance of the window relative to the screen


Window Object Reference Window Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook