Javascript / Misc. / Position of cursor
to get the relative position (x,y) of the cursor on the screen.
General Details
Snippet uploaded by: snippet
Email : webmaster@snippetlibrary.com
Snippet By: Jon Hanlon
<!---Head--->
<html>
<head>
<script language="Javascript">
function findMouse() {
divXY.innerText="The mouse is at (" + event.clientX + " , "
+ event.clientY + ")";
}
</script>
</head>
<!---Body--->
<body onmousemove="findMouse()">
<h1>Mouse Around</h1>
<div id="divXY">Move the mouse</div>
<br>
</body>
</html>
No Reviews to show
