3 main ways of modifying an element's style

PHOTO EMBED

Tue Apr 28 2020 19:41:37 GMT+0000 (Coordinated Universal Time)

Saved by @goblindoom95 #css

const button = document.getElementById("superCoolButton");

// 1 - setting the property
// properties are in camel.Case
button.style.backgroundColor = "black"; 
button.style.color = "white";

// 2 - by using keys to set the property 
// keys are in the kebab-case
button.style["background-color"] = "black"; 
button.style["color"] = "white";

// 3 - setting the css Text property will parse it as normal css. 
button.style.cssText = "background-color:black; color:white;";
content_copyCOPY

https://twitter.com/Duiker101/status/1253341244492664837