表单标签的Jquery选择器问题

表单标签的Jquery选择器问题,jquery,label,selector,Jquery,Label,Selector,我正在尝试使用表单标签创建选择器 $("label:not[for='other']") $("label[for='other']") <label for="other"> <label for="somethingElse"> $(“标签:非[用于其他]”) $(“标签[for='other']”) 如果有人选择“其他”的标签,请做些什么。如果他们为任何不是“其他”的东西选择标签,那么就做其他的事情 您可以执行$(“label[for!='other'])来选

我正在尝试使用表单标签创建选择器

$("label:not[for='other']")
$("label[for='other']")

<label for="other">
<label for="somethingElse">
$(“标签:非[用于其他]”)
$(“标签[for='other']”)
如果有人选择“其他”的标签,请做些什么。如果他们为任何不是“其他”的东西选择标签,那么就做其他的事情

您可以执行
$(“label[for!='other'])
来选择没有将
for
属性设置为'other'的标签。

使用:

$("label:not([for='other'])")
或:


“选择”或“挑选”标签是什么意思?@peter p-我猜他的意思是点击。。也许吧?请接受回答。
$("label[for!='other']")