Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用表单标签制作选择器。
$("label:not[for='other']") $("label[for='other']") <label for="other"> <label for="somethingElse">
如果有人选择了“其他”的标签,那就做点什么。如果他们为任何不是“其他”的东西选择标签,请执行其他操作。
您可以$("label[for!='other']")选择没有将for属性设置为“其他”的标签。
$("label[for!='other']")
for
利用:
$("label:not([for='other'])")
或者: