📜  javascript代码示例中的classlist.contain

📅  最后修改于: 2022-03-11 15:04:31.045000             🧑  作者: Mango

代码示例2
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'";
}