Answers for "classlist does not contain javascript"

1

if classlist contains js

element.classList.contains(class);
Posted by: Guest on December-10-2020
0

classlist.contain in javascript

let span = document.querySelector("span");
let classes = span.classList;
let result = classes.contains("d");
if (result) {
  span.textContent = "The classList contains 'c'";
} else {
   span.textContent = "The classList does not contain 'c'";
}
Posted by: Guest on February-06-2021

Code answers related to "classlist does not contain javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language