jQuery"not readonly"选择器

fea*_*net 63 jquery jquery-selectors

我在寻找......

$(':input:not(readonly)') // all inputs which are not readonly
Run Code Online (Sandbox Code Playgroud)

但努力寻找语法.

有什么指针吗?谢谢

hal*_*dan 121

这应该工作:

$(":input:not([readonly])")
Run Code Online (Sandbox Code Playgroud)

  • 我认为只需要`[readonly]`就行了......属性的存在就足够了.http://api.jquery.com/has-attribute-selector/ (21认同)

Adr*_*ner 34

$('input:not([readonly])')
Run Code Online (Sandbox Code Playgroud)

会覆盖readonly,readonly ="true"和readonly ="readonly"