var t='3'; runCount(t); function runCount(t){ if(t > 0){ document.getElementById('countDown').innerHTML = t; t--; setTimeout(function(){runCount(t)},1000); }else{ location.href="/suser_/Login/loginShow"; } }