Javascript examples for DOM Event:pagex
Get user event coordinate on page
<html> <head> <script type="text/javascript"> function showCoords(evt){/*from w ww. j a v a 2 s . com*/ document.getElementById("character").style.left = evt.pageX; document.getElementById("character").style.top = evt.pageY; } </script> </head> <body onmousedown="showCoords(event)"> <div id="character" style="position: absolute; top: 100px; width: 80px; height: 40px; background:black;"> Char </div> </body> </html>