JavaScript Window screenLeft Tutorial

In this section, we will learn what the Window screenLeft property is and how to use it in JavaScript.

JavaScript Window screenLeft Property

The `screenLeft` property returns the distance between the left edge of the browser and the left side of the screen.

The return value of this property is pixel based. So if the value is 200, that means the distance is 200 pixels.

Note: if we maximize a browser window, the returned value of this property will be 0.

Also, this method is read-only.

Window screenLeft Syntax:

window.screenLeft

Example: using Window screenLeft property in JavaScript

console.log(window.screenLeft)

Output:

Depending on the current position of the browser window, the value of this property will change.

Leave a Reply