var t = 10; function countDown() { t -= 1; document.getElementById('sec-text').innerHTML = t; if (t == 0) { location.href="http://i-liliyu.com/"; } setTimeout("countDown()", 1000); } countDown();