Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

classlist add js to add more than one class

// to add
elem.classList.add("first", "second", "third"); // or,
elem.classList.add(...["first","second","third"]);

// to remove
elem.classList.remove("first", "second", "third"); // or,
elem.classList.remove(...["first","second","third"]);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #classlist #add #js #add #class
ADD COMMENT
Topic
Name
3+5 =