title: JQUERY + Increment Member Counter
body: <p>I'm building a member counter for a site that will look like this:</p>
  
  <p><img src="https://i.stack.imgur.com/aKOsJ.png" alt="enter image description here"></p>
  
  <p>I will use JQUERY/AJAX/PHP/Mysql to bring the new membership number to the site every 30secs or so. This i can do.</p>
  
  <p>The bit I'm struggling with is getting counter to increment. Basically I want it to count up by the new membership. If the increase was 3 members then it would display:</p>
  
  <p>2,145,356
  2,145,357
  2,145,358</p>
  
  <p>I would need a touch of a delay between number so it gives the feeling of incrementing.</p>
  
  <p>I have put the code I'm working on here: <a href="http://jsfiddle.net/adamadam123/V3MCu/8/" rel="nofollow noreferrer">http://jsfiddle.net/adamadam123/V3MCu/8/</a> </p>
  
  <pre><code>&lt;div id="siteCounterContainer"&gt;
    &lt;button id="siteCounterMembers"&gt;Increment&lt;/button&gt;
    &lt;span id="siteCounterNumber"&gt;2,145,355&lt;/span&gt;
  &lt;/div&gt;​
  
  
   $(function() {
  
  $('button#siteCounterMembers').click(function() {
      var ranNumber = 1 + Math.floor(Math.random() * 22);
      alert(ranNumber);
  
     var originalNumber = $('span#siteCounterNumber').text().replace(/\,/g, '');
     //alert(originalNumber);
  
     myInteger = parseInt(originalNumber);
     alert(myInteger);
  
     for(var i=0; i&lt;ranNumber; i++) {
         var newNumber = myInteger + 1;
         alert(newNumber);
  
     } 
  });
   });
  </code></pre>
  
  <p>any help would be greatly appreciated.</p>
  
  <p>thanks</p>