title: setInterval not updating html element
body: <p>Basically I'm trying to have my code update the value of an element every second.  Problem is my current code only updates it the first time. No errors in console either.</p>
  
  <p>The weird part is that the console.log() keeps running after but the element doesn't update and neither does the time variable</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 today = new Date();
  var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
  var date = today.getFullYear() + '/' + String(today.getMonth() + 1).padStart(2, '0') + '/' + String(today.getDate()).padStart(2, '0');
  
  setInterval(function() {
    time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
    var elTime = document.getElementById("time");
    elTime.textContent = time;
    console.log(time);
  }, 1000);</code></pre>
  </div>
  </div>
  </p>