到现在为止,我成功地使用了这个选择器:
$('input, textarea')
但问题是这也选择了具有type=password
我知道我可以这样选择:
$("input[type=text],input:not([type]),textarea")
但是其他类型呢?
我想选择所有没有将type属性设置为password
的输入。
我试图使用:not
选择器,但无法成功使用。
$("input:not(:password)")
似乎不工作
像这样:
$("input[type!='password'], textarea")
Try
$('input:not([type="password"]), textarea')
jQuery没有:password
选择器
attributeNotEqual
选择器:
$(':input[type!="password"]')
注意这个例子也使用了:input
选择器,它选择了所有的输入类型,包括textarea
和select
元素。