[javascript] Javascript - Track mouse position

What I think that he only wants to know the X/Y positions of cursor than why answer is that complicated.

_x000D_
_x000D_
// Getting 'Info' div in js hands_x000D_
var info = document.getElementById('info');_x000D_
_x000D_
// Creating function that will tell the position of cursor_x000D_
// PageX and PageY will getting position values and show them in P_x000D_
function tellPos(p){_x000D_
  info.innerHTML = 'Position X : ' + p.pageX + '<br />Position Y : ' + p.pageY;_x000D_
}_x000D_
addEventListener('mousemove', tellPos, false);
_x000D_
* {_x000D_
  padding: 0:_x000D_
  margin: 0;_x000D_
  /*transition: 0.2s all ease;*/_x000D_
  }_x000D_
#info {_x000D_
  position: absolute;_x000D_
  top: 10px;_x000D_
  right: 10px;_x000D_
  background-color: black;_x000D_
  color: white;_x000D_
  padding: 25px 50px;_x000D_
}
_x000D_
<!DOCTYPE html>_x000D_
<html>_x000D_
  _x000D_
  <body>_x000D_
    <div id='info'></div>_x000D_
        </body>_x000D_
  </html>
_x000D_
_x000D_
_x000D_