<style>
#are{
width: 300px;
height: 50px;
border: 1px solid #0000FF;
margin-bottom:10px;
}
#showMsg{
width: 300px;
height: 20px;
border: 1px solid #FF00FF;
}
</style>
<div id="are"></div>
<div id="showMsg"></div>
<script type="text/javascript">
var are = document.getElementById("are")
var showMsg = document.getElementById("showMsg")
are.onmousemove = function(event){
console.log(event)
event = event || window.event
var x = event.clientX
var y = event.clientY
showMsg.innerHTML = "x:"+x+"y:"+y
}
</script>