<html>
<head>
</head>
<body>
<div id="counter">3</div>
<a href="javascript://" onclick="countDown();">Countdown start</a>
<script type="text/javascript">
function countDown() {
var e = document.getElementById('counter'),
x = setInterval(function () {
if (e.innerHTML != 0) {
e.innerHTML--;
} else {
clearInterval(x), e.innerHTML = 'Готово';
}
}, 1000);
}
</script>
</body>
</html>