y property

Sets or retrieves the y-coordinate (in pixels) of the mouse pointer, or user's finger, offset from the closest relatively positioned parent element of the element that fired the event.

Syntax

JavaScript

p = object.y

Property values

Type: Integer

the y-coordinate, in pixels.

Remarks

The y property returns a coordinate relative to the body element.

If the mouse or finger is outside the window at the time the event fires, this property returns -1.

Examples

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


<BODY onmousemove="window.status = 'X=' + window.event.x + 
    ' Y=' + window.event.y">

See also

event

 

 

Send comments about this topic to Microsoft

Build date: 11/14/2012

Show:
© 2014 Microsoft