how to set classname in javascript 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");