title: How can I get mouse location in javascript?
body: <p>I am working recently with a js game which requires the <em>mouse position</em> to change the <em>background color</em>,
  I have tried with</p>
  <p><code>event.clientX, event.clientY</code> and <code>event.pageX , event.pageY</code></p>
  <p>and now it had became:-</p>
  <pre><code>function l(){
      let x = event.pageX ;
      let y = event.pageY;
      document.bgColor = 'rgb($(x),$(y),$((x/2+y/2))'
  };
  
  document.body.addEventListener('mousemove',l());
  </code></pre>
  <p>but ,still it gives error,</p>
  <pre><code>uncaught TypeError: Cannot read property 'pageX' of undefined
  </code></pre>
  <p>If anyone solves my problem, a Great Thanks for him in advance
  Have a good time :-)</p>