I'm trying to make my button change state depending on a boolean. This looks like it would work and I thought it would but it just changes to white. idek why. Please help.
function dropDown(){
var isClicked = false;
var button = document.getElementById("bigbutton");
if(isClicked == false){
button.style.backgroundColor = "red";
isClicked = true;
}
if(isClicked == true){
button.style.backgroundColor = "white";
isClicked = false;
}
}
Aucun commentaire:
Enregistrer un commentaire