js原生判断元素是否包含指定类
2020-12-25 10:50:41

var node = document.getElementById('demo')
if (node.classList.contains('class')) {
    console.log('包含制定的class');
}
每日一句
Waste no more time arguing what a good man should be, be one. - Marcus Aurelius