This sort of works, so you can build on it yourself:
<!DOCTYPE html>
<html>
<head>
</head>
<body onmousemove="showCoords(event)" onmouseout="clearCoor()">
<script type="application/javascript">
function showCoords(event) {
var x = event.clientX;
var y = event.clientY;
var coor = "X coords: " + x + ", Y coords: " + y;
document.getElementById("what").innerHTML = coor;
}
function clearCoor() {
document.getElementById("what").innerHTML = "";
}
</script>
<h2>A simple Javascript test</h2>
<p id="what">this is what</p>
</body>
</html>