Mega Code Archive

 
Categories / JavaScript Tutorial / Event
 

Get XY 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>