title: Cannot set properties of undefined (setting 'left')
body: <p>i'm trying to move the ball to right but i got this error :
  Cannot set properties of undefined (setting 'left')
  i tried to search but all the answers says that my code is correct</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>var ballSpeed = 3;
  var ballPosition = 0;
  var ballTime = 1;
  var ball = $('#ball');
  
  
  function bT() {
    ballPosition = ballPosition + ballSpeed;
    ball.style.left = ballPosition + "px";
  }
  
  var ii =setInterval(bT, 1);
  console.log(ii);</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.window{
    background-color: #00FFDD;
    height:100vh;
    margin: 0px;
  }
  
  #ball{
    position: absolute;
    height: 100px;
    width: 100px;
    border-radius: 50%;
    background-color: red;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
     
    &lt;body&gt;
  &lt;div class="window"&gt;
  &lt;div id="ball"&gt;&lt;/div&gt;
  &lt;/div&gt;
  
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="index.js" charset="utf-8"&gt;&lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>