1var timeleft = 10;
2var downloadTimer = setInterval(function(){
3 if(timeleft <= 0){
4 clearInterval(downloadTimer);
5 }
6 document.getElementById("progressBar").value = 10 - timeleft;
7 timeleft -= 1;
8}, 1000);
9<progress value="0" max="10" id="progressBar"></progress>