Get X/Y screen position (IE) : Mouse « Event « JavaScript DHTML






Get X/Y screen position (IE)

  

<html>
<head>
<title>X/Y Marks the Spot</title>
<script type="text/javascript">
function mouseDown(nsEvent) {
  var theEvent = nsEvent ? nsEvent : window.event;
  var locString = "X = " + theEvent.screenX + " Y = " + theEvent.screenY;
  alert(locString);
}

document.onmousedown=mouseDown;
</script>

</head>
<body>
</body>
</html>

   
    
  








Related examples in the same category

1.Mouse wheel Delta
2.'button' Example