title: Display auto-increment values of a counter
body: <p>I wish to animate a counter from 0 to a given value.</p>
  
  <p>I've tried with a <code>for()</code> loop, but it freezes and then only displays the end value.</p>
  
  <p>// HTML</p>
  
  <pre><code>&lt;input type="hidden" value="100000" id="amount"/&gt;
  &lt;input type="text" value="0" id="count"/&gt;
  &lt;input type="button" value="run" id="runner"/&gt;​
  </code></pre>
  
  <p>// JS</p>
  
  <pre><code>$('#runner').click(function(){
     var amount=parseInt($('#amount').val());
     for(i=0;i&lt;=amount;i++)
     {
        $('#count').val(i);
         setTimeout(1);
     }
  });
  </code></pre>
  
  <p>​You can see it here : <a href="http://jsfiddle.net/P4Xy6/1/" rel="nofollow">http://jsfiddle.net/P4Xy6/1/</a></p>
  
  <p>Any idea on how I could display the values between 0 and the given value ? Or any better way to do that ?</p>