Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

html add class

//Use element.classList.add to add a class:

let element = document.getElementById("div1");
element.classList.add("otherclass");
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #html #add #class
ADD COMMENT
Topic
Name
3+2 =