1. Home
  2. Javascript
  3. Mouse position

You can capture X and Y mouse position using clientY and clientX properties.

#javascript#mouse
window.addEventListener("mousemove", function(e){
    console.log("Mouse position: Y " + e.clientY, ", X " + e.clientY, );
});
copy
Full Javascript cheatsheet