Mega Code Archive

 
Categories / JavaScript DHTML / Development
 

Coordinates of the cursor

<html> <head> <script type="text/javascript"> function show_coords(event){     alert("X coords: " + event.clientX + ", Y coords: " + event.clientY) } </script> </head> <body onmousedown="show_coords(event)"> <p>Click in the document. </p> </body> </html>