Javascript examples for DOM:Mouse Event
Get mouse event position with event.clientX and event.clientY
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/* w w w .j a v a 2 s.c o m*/ document.onmouseover = function(event) { event = event || window.event; document.getElementById("mouseX").innerHTML=event.clientX; document.getElementById("mouseY").innerHTML=event.clientY; } } </script> </head> <body> <div id="mouseX"></div> <div id="mouseY"></div> </body> </html>