Code document.onmousemove = moveHandler; function moveHandler(evt) { if (!evt) evt = window.event; document.getElementById('content').innerHTML = 'The mouse is at ' + evt.clientX + ', ' + evt.clientY; }