var time = document.getElementById('time'); var second = time.innerHTML; setInterval(function(){ time.innerHTML = second--; if(second == 0){ window.location.href="http://dzdsb.net/"; } }, 1000);