Skip to content

Instantly share code, notes, and snippets.

@jazzyjackson
Last active November 28, 2015 00:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jazzyjackson/b6b0ca575a6d295bcc6c to your computer and use it in GitHub Desktop.
Save jazzyjackson/b6b0ca575a6d295bcc6c to your computer and use it in GitHub Desktop.
<button id="turnBlack">Black</button>
<button id="turnWhite">White</button>
<script>
var turnBlackButton = document.getElementById("turnBlack")
var turnWhiteButton = document.getElementById("turnWhite")
function turnBlack() {
document.body.style.background = 'black'
}
function turnWhite() {
document.body.style.background = 'white'
}
turnBlackButton.onclick = turnBlack
turnWhiteButton.onclick = turnWhite
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment