так пойдёт?
<style>
div {
position: absolute;
left: 40%;
top: 40%;
width: 50px;
height: 50px;
background: lightgreen;
padding: 20px;
}
</style>
<div>div</div><span></span>
<script>
window.onload = function () {
document.body.children[0].onmousemove = function (e) {
e = e || event;
var coords = this.getBoundingClientRect();
var x = parseInt(e.clientX - coords.left);
var y = parseInt(e.clientY - coords.top);
this.nextSibling.innerHTML = x + '<br>' + y;
}
}
</script>