// Here are two different ways
document.getElementById("myH1").style.color = "red";
element.style.backgroundColor = "red"; // set the background color of an element to red
// Getting the element first
var myElement = document.querySelector("#myElement");
// examples for updating styles
myElement.style.color = "blue";
myElement.style.backgroundColor = "red";