Answers for "syntax of classlist .contains"

5

js check for class in classList

element.classList.contains(className);
Posted by: Guest on August-27-2020
0

.classList

// .classList method returns an array of the classes attached to the element it is called with.
document.getElementById("myDIV").classList
// It returns
// [ 'className1', 'className2', ... ]
Posted by: Guest on April-26-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language