I have the following code, I am trying to simply count to ten using a FOR loop
Through each iteration I want to use jQuery
to update a div element with the value of i
for (i=0;i<=10;i++){
setTimeout(function(){
$(".test").html(i);
},10000);
}
The problem is, the loop will execute and not display anything until finished, which will simply be the number 10.
Is there a way to achieve what I need?
Thank