access the styles of an element in javascript code example Example: document style document.getElementById("myH1").style.color = "red";