Skip to content

Instantly share code, notes, and snippets.

@wibawasuyadnya
Created July 15, 2022 10:50
Show Gist options
  • Save wibawasuyadnya/a8a21200327e1d0696d7958d27626e96 to your computer and use it in GitHub Desktop.
Save wibawasuyadnya/a8a21200327e1d0696d7958d27626e96 to your computer and use it in GitHub Desktop.
var seat = 43;
document.getElementById('countdown').innerHTML = seat;
const myInterval = setInterval(decre, 15000);
function showChange(){
seat = seat - 2
document.getElementById('countdown').innerHTML = seat;
}
function decre(){
if(seat > 41){
showChange()
}else{
clearInterval(myInterval);
window.setTimeout(showChange, 60000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment