Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

clientX Event Attribute

clientX Event Attribute

Event Object Reference 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 Reference Event Object