<div id="timer">10</div> <input type="button" value="Запустить" onclick="this.onclick = null; var t = document.getElementById('timer'); (function tick() { if (--t.innerHTML) setTimeout(tick, 1000); else location.href = 'http://google.ru'; })()" />