I am counting values from 0 to 100 in JavaScript, but the whole count should take 3 seconds to reach 0 to 100.but right now its happening withing milliseconds.
how can i do that?
<span><span id="counter"> </span> of 100 files</span> <script> for(var i=0;i<=100;i++) { setTimeout(document.getElementById("counter").innerHTML = i, 3000); } </script> Example:
http://www.downgraf.com/wp-content/uploads/2014/09/03-yodaloader.gif