Created
October 22, 2015 01:15
-
-
Save petermoresi/a3494de446ec420810ea to your computer and use it in GitHub Desktop.
digital countdown clock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Paste this into the console and it will take over the page.