CSS JS
(quick guide & examples)
<p id="demoA">Hello</p> document.getElementById("demoA") .style.color = "Red";
<p id="demoB">Hello</p> document.getElementById("demoB") .style.cssText = "color: red; font-weight: bold;";
<p id="demoC">Hello</p> document.getElementById("demoC") .setAttribute ("style", "color: red; font-weight: bold;");
.demo { color: red; } <p id="demoD">Hello</p> document.getElementById("demoD") .className = "demo";
:root { --textcol: red; } .demo { color: var(--textcol); } <p class="demo">Hello</p> document.documentElement.style. setProperty ("--textcol", "blue");