Get xy-coordinates:

X-position of the mouse cursor

Y-position of the mouse cursor Code: <script type="text/javascript"> window.onload = init; function init() { if (window.Event) { document.captureEvents(Event.MOUSEMOVE); } document.onmousemove = getCursorXY; } function getCursorXY(e) { document.getElementById('cursorX').value = (window.Event) ? e.pageX : event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft); document.getElementById('cursorY').value = (window.Event) ? e.pageY : event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); } </script>