Answers for "how to use javascript so the color box change color and then change back"

0

how to use javascript so the color box change color and then change back

var btn = document.getElementById("#btn");
var box = document.getElementById("#box");

function changeColor() {
  box.style.backgroundColor = "red";
}

function ifColor() {
  if (box.style.backgroundColor == "red") {
    box.style.backgroundColor = "blue";
  }
}
Posted by: Guest on June-20-2021

Code answers related to "how to use javascript so the color box change color and then change back"

Code answers related to "Javascript"

Browse Popular Code Answers by Language