如何排除具有特定类
名称的
标记元素?
<span class="test" />
<span class="test asd" />
document.querySelectorAll('span.test'); //how to exclude all spans with "asd" as class name?
使用
:not
CSS伪类:
document.querySelectorAll('span.test:not(.asd)');
原文链接:https://www.f2er.com/js/154015.html