#countdown {
font-size: 36px;
text-align: center;
color: #333;
}
#countdown div {
display: inline-block;
padding: 10px;
background-color: #eee;
border-radius: 3px;
margin: 0 10px;
}
let countdownSeconds = 10; // Set the countdown time in seconds
const timerElement = document.getElementById(‘timer’);
const countdown = setInterval(() => {
if (countdownSeconds <= 0) {
clearInterval(countdown);
timerElement.innerHTML = “Time’s up!”;
} else {
timerElement.innerHTML = countdownSeconds;
countdownSeconds–;
}
}, 1000);
10