Jquery – Get the mouse cursor x and y axis

Want to know where your mouse cursor is?

$(document).ready(function() {  
       $().mousemove(function(e){  
         //display the x and y axis values inside the div with the id XY  
        $('#XY').html("X Axis : " + e.pageX + " | Y Axis " + e.pageY);  
      });  
    // how to use  
    <div id="XY"></div>  
      
    });

Leave a Reply

Your email address will not be published. Required fields are marked *

*