Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

change class js

let containsClass = element.classList.contains('my-class');
element.classList.toggle('my-class', !containsClass);
 
PREVIOUS NEXT
Tagged: #change #class #js
ADD COMMENT
Topic
Name
1+9 =