place = getElementById("counter"); start = 1000; stop = 500; function timer() { if (start-- > stop) { place.innerHTML = start; setTimeout(timer,10); } } timer();