asp.net.ph

Skip Navigation Links

x Property

DHTML Events


Returns the horizontal position of the mouse when the event fires.

Syntax


HTML N/A
Script [ iX = ] event.x

Possible Values


iX Integer specifying the horizontal coordinate of the mouse, in pixels.

The property is read-only with no default value.

Remarks

If the mouse is outside the window when the event is called, this property returns -1.

If no object in the hierarchy has been positioned, the BODY object is the default.

Example

The following example displays the current mouse position in the browser's status window.

<body onmousemove="window.status "X=' + 
  window.event.x + ' Y=' + window.event.y">
Applies To

event



>

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note