This page is Almost Ready

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

pageX

Summary

Gets the x-coordinate of the mouse cursor, relative to the upper-left corner of the page.

Property of dom/objects/MouseEventdom/objects/MouseEvent

Syntax

Note: This property is read-only.

var xCoordinate = event.pageX;

Return Value

Returns an object of type NumberNumber

The X coordinate of the mouse cursor.

Notes

The pageX property is equivalent to the clientX value plus the scrollLeft value of the document, as the following code example shows.

var pageX = event.clientX + document.documentElement.scrollLeft;

Related specifications

CSSOM View
Working Draft

See also

Related articles

CSSOM

Related pages

Attributions