clientX Event Attribute
Event Object
Definition and Usage
The clientX event attribute returns the horizontal coordinate of the mouse pointer relative to the browser page (or client area) when the event is triggered.
The client area refers to the current window.
Syntax
event.clientX
Example
Example
The following example shows the coordinates of the mouse pointer when the event occurs:
var
x
=
event
.
clientX
;
var
y
=
event
.
clientY
;
Try it »
Event Object