Get screen position for the event

Description

Get screen position for the event

Example


<html>
<head>
<title>X/Y Marks the Spot</title>
<script type="text/javascript">
  function mouseDown() {<!--  w w w .ja v  a2  s  .co  m-->
    var locString = "X = " + window.event.screenX + " Y = "
        + window.event.screenY;
    document.write(locString);
  }

  document.onmousedown = mouseDown;
</script>

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

Click to view the demo





















Home »
  Javascript »
    Javascript Reference »




Array
Canvas Context
CSSStyleDeclaration
CSSStyleSheet
Date
Document
Event
Global
History
HTMLElement
Input Element
Location
Math
Number
String
Window