event.pageY Property - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:event.pageY

Description

The event.pageY property returns the position of the mouse pointer.

Syntax

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:

Demo Code

ResultView the demo in separate window

<!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>

Related Tutorials