asp.net.ph

Skip Navigation Links

clientY Property

event Properties   DHTML Events


DOM Level 2 Specification.

Retrieves the vertical position of the mouse relative to the size of the client area.

Syntax


HTML N/A
Script [ iYPos = ] event.clientY

Possible Values


iYPos Integer specifying the y-coordinate of the mouse hit position, in pixels.

The property is read-only with no default value.

Remarks

This property returns the y-coordinate of the cursor position at which the event occurred, relative to the top edge of the size of the window area, excluding any window menus, borders or scroll bars.

Example

The following example demonstrates use of the clientY property to determine the mouse position relative to the window. The status window shows the mouse position at all times.

<script language="JavaScript">
function clientCoords ( ) {
   var offsetInfo = ""
   clientInfo = "The x coordinate is: " + 
      window.event.clientX + "\r"
   clientInfo += "The y coordinate is: " + 
      window.event.clientY + "\r"
   alert ( clientInfo );
}
</script>
</head>
<body onmousemove="window.status "X=' + 
   this.clientX + ' Y=' + this.clientY"
   ondblclick="clientCoords ( )">

This feature requires Microsoft® Internet Explorer® 4.0 or later.

 Show me 

Applies To

event

See Also

clientX, offsetX, offsetY, screenX, screenY



>

© 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