jQuery Mouse Position with pageX and pageY

Pointer events expose coordinates through the event object. event.pageX is the horizontal position and event.pageY is the vertical position relative to the document.

Coordinate Properties Top ↑

event.pageX
event.pageY

Display the Click Position Top ↑

$( function () {
    $( document ).on( "click", function (event) {
        $( "#t1" ).text(
            "X: " + event.pageX + ", Y: " + event.pageY
        );
    });
});

Open the page-coordinate demo →

For coordinates relative to a particular element, combine the event position with that element's offset. See also the existing element-coordinate demo.






plus2net.com






✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer