document.getelementbyid(''h1").style code example Example: how to change css using javascript document.getElementById("myText").className = "anyNewClass"