Javascript examples for jQuery Method and Property:event.pageY
The event.pageY property returns the position of the mouse pointer.
Parameter | Require | Description |
---|---|---|
event | Required. | The event parameter comes from the event binding function |
The following code shows how to Return the position of the mouse pointer:
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $(document).mousemove(function(event){ $("span").text("X: " + event.pageX + ", Y: " + event.pageY); });//from w w w. j a va2s . co m }); </script> </head> <body> <p>The mouse pointer position is at: <span></span></p> </body> </html>