Skip to content

Instantly share code, notes, and snippets.

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