Jquery selector question for form labels
I'm trying to make a selector using form labels.
$("label:not[for='other']")
$("label[for='other']")
<label for="other">
<label for="somethingElse">
If someone selects the label for 'other', do somethin开发者_StackOverflowg. If they pick a label for anything that isn't 'other' do something else.
You can do $("label[for!='other']")
to select the labels that do not have the for
attribute set to 'other'.
Use:
$("label:not([for='other'])")
or:
$("label[for!='other']")
精彩评论