Refresh Timer

Refresh timer with Countdown

by Bryan McIntosh

HTML

<div id="countdown"></div>

JavaScript

(function countdown(remaining) {
    if(remaining === 0)
        location.reload(true);
    document.getElementById('countdown').innerHTML = remaining;
    setTimeout(function(){ countdown(remaining - 1); }, 1000);
})(5);