Red or Green Is there a way for me to write fewer lines of code in this function? I want it to switch between the two colors when you press one of the buttons. The function green() is the exact opposite of red. red or green
function red() { document.getElementById("header").innerHTML = "red" document.getElementById('header').style.color = "red" document.getElementById('redButton').style.color = "white" document.getElementById('redButton').style.backgroundColor = "red" document.getElementById('greenButton').style.color = "black" document.getElementById('greenButton').style.backgroundColor = "grey" }