标签: jquery css css-selectors
我想用jQuery选择除myclass之外的所有h1标签。例如,我想选择< H1>但我不想选择< h1 class =“myclass”>
由于
答案 0 :(得分:5)
尝试:not() selector或not method:
:not()
not
$("h1:not(.myclass)") $("h1").not(".myclass")
答案 1 :(得分:5)
$("h1:not('.myclass')")
http://api.jquery.com/not-selector/