<head>
<script>
function startCountdown(x) {
if(x == 0) {
document.getElementById("countdown").innerHTML = "take off!!!";
} else {
document.getElementById("countdown").innerHTML = "t-minus " + x;
setTimeout(function() {
startCountdown(x-1);
}, 1000);
}
}
</script>
</head>
<body onload="startCountdown(10)">
<div id="countdown"></div>
</body>
Comments