This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

screenX

Summary

Gets the x-coordinate of the mouse pointer, relative to the upper-left corner of the screen.

Property of dom/MouseEventdom/MouseEvent

Syntax

Note: This property is read-only.

var xCoordinate = event.screenX;

Return Value

Returns an object of type NumberNumber

The X coordinate of the mouse cursor.

Notes

Screen coordinates depend on the document zoom level. At 200% magnification, some user agents may report the “logical” position of a pixel as half of the distance of the same position at 100% zoom.

Related specifications

DOM Level 3 Events
Working Draft

Attributions