Example

Show the position of the mouse pointer:

$(document).mousemove(function(e){
  $("span").text("X: " + e.pageX + ", Y: " + e.pageY);
});

Try it yourself »

Definition and Usage

The pageX() property is the position of the mouse pointer, relative to the left edge of the document.

Syntax

event.pageX

Parameter Description
event Required. Specifies the event to use. The event parameter comes from the event binding function