// Here are two different ways document.getElementById("myH1").style.color = "red"; element.style.backgroundColor = "red"; // set the background color of an element to red
// Bad: element.setAttribute("style", "background-color: red;"); // Good: element.style.backgroundColor = "red";
document.getElementById("myH1").style.color = "red";