title: Digital Clock on JavaScript not updating every seconds
body: <p>I am trying to create a digital clock using JavaScript and I am running into some problem. The digital clock does show up and the time is correct. However, it does not update every seconds, though the setinterval seems to be correct.</p>
  <pre><code>window.onload = pageLoad;
      function pageLoad(){
  
      var hours = document.getElementById(&quot;hoursOut&quot;);
      var mins = document.getElementById(&quot;minsOut&quot;);
      var secs = document.getElementById(&quot;secsOut&quot;);
  
  
      var dateVar = new Date();
      var currentHours = dateVar.getHours();
      var currentMinutes = dateVar.getMinutes();
      var currentSeconds = dateVar.getSeconds();
      var tiktok;
  
      
      function displayTime() {
          hours.innerHTML = currentHours + &quot;:&quot;;
          mins.innerHTML = currentMinutes + &quot;:&quot;;
          secs.innerHTML = currentSeconds;
      }   
  
  
  
      function startClock(){
          displayTime();
          tiktok = setInterval(displayTime,1000);
      }
  
      
      }
      ```
  </code></pre>