Skip to content

Instantly share code, notes, and snippets.

@riedayme
Created May 14, 2020 09:35
Show Gist options
  • Save riedayme/8b699f446a7a93853a1725ff06ed72a5 to your computer and use it in GitHub Desktop.
Save riedayme/8b699f446a7a93853a1725ff06ed72a5 to your computer and use it in GitHub Desktop.
Count Simple Javascript
<div id="count"></div>
<script type="text/javascript">
var time = 5;
function CountDown(){
var eltime = document.getElementById('count');
eltime.innerHTML = time;
time = time - 1;
if (time < 0) {
alert('success');
}else {
window.setTimeout('CountDown()',1000);
}
}CountDown();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment