/index.html Secret
Created
November 8, 2018 14:17
Star
You must be signed in to star a gist
Stopwatch with JavaScript (2) – Start & Stop with Spacebar –
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
... | |
document.onkeydown = function(event) { | |
if (event) { | |
if (event.keyCode == 32 || event.which == 32) { | |
if(status == 1) { | |
stop(); | |
} else if (status == 0) { | |
start(); | |
} | |
} | |
} | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment