Prev Demo
jQuery
>
Event.Pagex & Event.Pagey - Get Mouse Position
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <style> #pEventXEventY { background-color:lightgreen; padding:25px; } </style> </head> <body> <div id="pEventXEventY">This page is event.pageX and event.pageY page, you can check by moving the curser on the color surrounded area. </div> <script> $("#pEventXEventY").bind("mousemove", function (e) { $(this).text("pageX: " + e.pageX + " pageY: " + e.pageY); }); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output