<html> <head> <script type="text/javascript"> function showPos(){ var mp = 'X=' + window.event.clientX + ' Y=' + window.event.clientY ; document.getElementById('mousePos').innerText = mp; } </script> </head> <body onmousemove=showPos()> <div id="mousePos"></div> </body></html>