style through javascript

JavaScript
 document.getElementById("myH1").style.color = "red";  element.style.backgroundColor = "red";   // set the background color of an element to red
Source

Also in JavaScript: