prova cosi, praticamente la view del body non copriva tutta la sua altezza.
codice:
<!doctype html>
<html lang="it-IT">
<head>
<title>mouse position</title>
<style>
html,
body {
margin: 0;
height: 100vh;
}
#cordinate {
margin: 0;
padding: 10px;
user-select: none;
}
</style>
</head>
<body onmousemove="PosizioneCursore()">
<div id="cordinate">
Posizione del mouse sull'asse delle X:<span id="X"></span> <br>
Posizione del mouse sull'asse delle Y:<span id="Y"></span>
</div>
<script>
function PosizioneCursore() {
var asse_x = event.clientX;
var asse_y = event.clientY;
document.getElementById("X").innerHTML = asse_x;
document.getElementById("Y").innerHTML = asse_y;
}
</script>
</body>
</html>