title: How to Create a simple Cursor tracking ball with JS?
body: <p>I have created a simple gradient ball.</p>
  <p>what I want to do is if I move the mouse cursor anywhere on the page created ball flows along with the mouse cursor.
  I have added onmousemove event to the JS but it does't really work properly.</p>
  <p>please show me the error in my code.</p>
  <p>thank you!</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let cursor=document.querySelector('.ball');
  
  cursor.addEventListener('onmousemove', (e)=&gt;{
      let x= e.pageX;
      let y= e.pageY;
  
      cursor.style.left= x+'px';
      cursor.style.top= y+'px';
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.ball{
      background-image: linear-gradient(90deg, rgba(2,0,36,1) 0%, rgba(9,9,121,1) 0%, rgba(4,116,191,1) 60%, rgba(0,212,255,1) 97%);
      height: 70px;
      width: 70px;
      border-radius: 50%;
      box-shadow: 0px 0px 13px 1px rgba(9,9,121,0.73);
      transition: 0.1s;
      pointer-events: none;
      position: fixed;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
      &lt;link rel="stylesheet" href="stylesheet.css"&gt;
      &lt;title&gt;Document&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div class="ball"&gt;&lt;/div&gt;
  
      &lt;script src="script.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>