Get mouse position with on mouse move event (IE) : Mouse Event « Event « JavaScript DHTML
- JavaScript DHTML
- Event
- Mouse Event
Get mouse position with on mouse move event (IE)
<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
function moved()
{
window.status = "X = " + event.x + " Y = " + event.y
follower.style.pixelTop = event.y
follower.style.pixelLeft = event.x
}
</script>
</head>
<body onmousemove="moved()">
<p id="follower" style="position:absolute">Squeak!</p>
</body>
</html>
Related examples in the same category