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
pageX
Related pages
- DragEventDragEvent
- MouseWheelEventMouseWheelEvent
- WheelEventWheelEvent
Reference
- clientXclientX
- offsetXoffsetX
- screenXscreenX
x
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]