Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript change element class

//Overwrite all classes
element.className = "class";

//Add class
element.classList.add("class");
 
PREVIOUS NEXT
Tagged: #javascript #change #element #class
ADD COMMENT
Topic
Name
2+1 =