change class of a div using javascript code example
Example 1: javascript give class to element
element.classList.add("div-class");
Example 2: javascript change element class
//Overwrite all classes
element.className = "class";
//Add class
element.classList.add("class");