title: Rest Countdown to Next day once target is hit
body: <p><strong>Goal</strong>: Im attempting to create A countdown clock that resets once it hits a certain time. Then counts down to say 1:00pm the next day, and repeats.</p>
  
  <p>Here is the code so far.</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>if(document.getElementById("countdown")) {
    intTime = function(n, len) {
      var intSeconds = n.toString();
      return (new Array((len - intSeconds.length + 1)).join('0')) + intSeconds;
    };
    
    var timerRunning = setInterval (
      function countDown() {
        var target = 13; // 1:00pm || 13:00hrs
        var now = new Date();
        
        //actual countdown timer
        var intHours = (target - 1) - now.getHours();
        var intMins = 59 - now.getMinutes();
        var intSecs = 59 - now.getSeconds();
        
        //Timer String
        var timeString = intTime(intHours, 2) + ':' + intTime(intMins, 2) + ':' + intTime(intSecs, 2);
        
        if (intHours &lt; 0) intHours = 0;
        if (intMins &lt; 0) intMins = 0;
        if (intSecs &lt; 0) intSecs = 0;
        if (now.getHours() &gt; target) {
            
        }
        document.getElementById('countdown').innerHTML = timeString;
       }, 1000
    );
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p id="timer"&gt;Order within &lt;span id="countdown"&gt;0&lt;/span&gt;&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The count down its self works.
  However im really unsure what to put in side this peace of code:</p>
  
  <pre><code>      if (now.getHours() &gt; target) {
  
        }
  </code></pre>
  
  <p>Ive tried adding <code>now() * 24;</code> ive tried increasing the target. 
  everything Ive tried presents the same result. 
  I get a minus and then its counting down again too something in two hours.</p>
  
  <p>I'm Racking my brain and im getting no where, Id appreciate any help that you can give me. Call me an idiot if you want for missing something glaringly obvious.</p>
  
  <p>Cheers.</p>