title: Set 24 hours remaining countdown
body: <p>Okay as you can probably tell from the title of this post. I'm trying to work how to create a 24 hour remaining count down clock. I just can't get my head around how to work this out.</p>
  
  <p>I've got it working with 5 minutes, but I just need a nudge in the right direction on how to turn this into hours instead of </p>
  
  <p><a href="http://jsfiddle.net/mjngwzw2/4/" rel="nofollow">JSFiddle Demo</a></p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;body&gt;
      &lt;input type="text" value="5"&gt;
      &lt;div&gt;Time Remaining &lt;span id="remainingTime"&gt;05:00&lt;/span&gt; minutes!&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>JavaScript/jQuery:</p>
  
  <pre><code>function Timer(duration, display) 
  {
      var timer = duration, minutes, seconds;
      setInterval(function () {
          minutes = parseInt(timer / 60, 10)
          seconds = parseInt(timer % 60, 10);
  
          minutes = minutes &lt; 10 ? "0" + minutes : minutes;
          seconds = seconds &lt; 10 ? "0" + seconds : seconds;
  
          display.text(minutes + ":" + seconds);
  
          if (--timer &lt; 0) {
              timer = duration;
          }
      }, 1000);
  }
  
  jQuery(function ($) 
  {
      var fiveMinutes = 60 * jQuery('#checkTime').val();
      var display = $('#remainingTime');
      Timer(fiveMinutes, display);
  });
  </code></pre>
  
  <p>No plugins please.</p>