inline style set color from variable code example Example: javascript add inline style css var element.style.setProperty("--my-var", jsVar + 4);