表单标签的Jquery选择器问题

Spe*_*age 3 jquery label selector

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

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

<label for="other">
<label for="somethingElse">
Run Code Online (Sandbox Code Playgroud)

如果有人选择"其他"标签,请执行某些操作.如果他们为任何不是"其他"的东西选择标签做其他事情.

Jac*_*kin 5

您可以$("label[for!='other']")选择没有将for属性设置为"其他" 的标签.