title: How to make real time count up with Javascript?
body: <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head lang="en"&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Count up&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
  
  &lt;h1&gt;number 1&lt;/h1&gt;
  &lt;div id="counter"&gt;&lt;/div&gt;
  
  &lt;br&gt;
  
  &lt;h1&gt;number 2&lt;/h1&gt;
  &lt;div id="counter_2"&gt;&lt;/div&gt;
  
  
  
  
  &lt;script&gt;
  
      var START_DATE = new Date("July 2, 2015 11:00:00"); // put in the starting date here
      var INTERVAL = 0.366; // in seconds
      var INCREMENT = 1; // increase per tick
      var START_VALUE = 7325698160; // initial value when it's the start date
      var count = 0;
  
      window.onload = function ()
      {
          var msInterval = INTERVAL * 1000;
          var now = new Date();
          count = parseInt((now - START_DATE)/msInterval) * INCREMENT + START_VALUE;
          document.getElementById('counter').innerHTML = count;
          setInterval("count += INCREMENT; document.getElementById('counter').innerHTML = count;", msInterval);
      }
  
  
  
  
      var START_DATE_2 = new Date("July 2, 2015 11:00:00"); // put in the starting date here
      var INTERVAL_2 = 0.366; // in seconds
      var INCREMENT_2 = 1; // increase per tick
      var START_VALUE_2 = 738160; // initial value when it's the start date
      var count_2 = 0;
  
      window.onload = function ()
      {
          var msInterval = INTERVAL_2 * 1000;
          var now = new Date();
          count_2 = parseInt((now - START_DATE_2)/msInterval) * INCREMENT_2 + START_VALUE_2;
          document.getElementById('counter_2').innerHTML = count;
          setInterval("count_2 += INCREMENT_2; document.getElementById('counter_2').innerHTML = count_2;", msInterval);
      }
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I had this count up, it worked well for just one number. However, when I was tying to add more, it did not work very well. It just display the second function. Anybody could help me out?? Thanks a lot!!!!</p>