Progress Bar

by Chris Nicholson

HTML

<progress value="0" max="100"></progress>

JavaScript

var i = 0;

var timer = setInterval(function(){
    updateProgress();
}, 30);

function updateProgress(){

    $('progress').attr('value', i);
    
    if(i > $('progress').attr('max')) {
        clearInterval(timer);
        alert("Done!");
    }
    
    i++;

}