Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<h1 id="turnBlack">Off</h1>
<h1 id="turnWhite">On</h1>
var turnBlackButton = document.getElementById("turnBlack")
var turnWhiteButton = document.getElementById("turnWhite")
function turnBlack() { = 'black' = 'white' = 'white'
function turnWhite() { = 'white' = 'black' = 'black'
turnBlackButton.onclick = turnBlack
turnWhiteButton.onclick = turnWhite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment