Your Search Results

    event.clientY

    « DOM Reference

    Summary

    Returns the vertical coordinate within the application's client area at which the event occurred (as opposed to the coordinates within the page). For example, clicking in the top-left corner of the client area will always result in a mouse event with a clientY value of 0, regardless of whether the page is scrolled vertically.

    Syntax

    var y = event.clientY;
    

    Example

    <html>
    <head>
    <title>clientX\clientY example</title>
    
    <script type="text/javascript">
    function showCoords(evt){
      alert(
        "clientX value: " + evt.clientX + "\n"
        + "clientY value: " + evt.clientY + "\n"
      );
    }
    </script>
    </head>
    
    <body onmousedown="showCoords(event)">
    <p>To display the mouse coordinates click anywhere on the page.</p>
    </body>
    </html>
    

    Notes

    See also clientX, screenX, and screenY.

    Specification

    DOM Level 2 Events: MouseEvent.clientY

    Document Tags and Contributors

    Last updated by: kscarfone,