Retrieves the y-coordinate of the mouse pointer's position relative to the parent element.
Syntax
HTML N/A Scripting [ iY = ] event.y
Possible Values
iY Integer that specifies the y-coordinate, in pixels. The property is read-only with no default value.
Remarks
In browser versions earlier than Microsoft® Internet Explorer 5, the y property retrieves a coordinate relative to the client.
If the mouse is outside the window at the time the event fires, this property returns -1. If an element is absolutely positioned and fires a mouse event, or is not the child of an absolutely positioned element, the y property returns a coordinate relative to the BODY element.
Example
This example displays the current mouse position in the browser's status window.
Sample Code
<BODY onmousemove="window.status = 'X=' + window.event.x + ' Y=' + window.event.y">
Applies To
event