js set class DOM code example
Example: javascript change element class
//Overwrite all classes
element.className = "class";
//Add class
element.classList.add("class");
//Overwrite all classes
element.className = "class";
//Add class
element.classList.add("class");