📅  最后修改于: 2022-03-11 15:04:30.640000             🧑  作者: Mango
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'";
}