Skip to content

Instantly share code, notes, and snippets.

@petermoresi
Created October 22, 2015 01:15
Show Gist options
  • Save petermoresi/a3494de446ec420810ea to your computer and use it in GitHub Desktop.
Save petermoresi/a3494de446ec420810ea to your computer and use it in GitHub Desktop.
digital countdown clock
var time = 1000;
function updateTimer() {
document.body.innerHTML = ('<div style="font-size: 6em">' + Math.round(time/60) + ":" + (--time%60) + '</div><br/><div>' + time + ' total seconds</div>')
}
var timerId = setInterval( updateTimer, 1000)
// reset with:
// clearInterval(timerId);
@petermoresi
Copy link
Author

Paste this into the console and it will take over the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment