如果我想选择所有选中的复选框,我可以这样做.
$('#mydiv input[type=checkbox]:checked')
Run Code Online (Sandbox Code Playgroud)
是否有类似的简单语法,让我选择所有未选中的复选框?
Hiya是的: 演示 http://jsfiddle.net/usvrb/
http://api.jquery.com/not-selector/
引用
Run Code Online (Sandbox Code Playgroud)The .not() method will end up providing you with more readable selections than pushing complex selectors or variables into a :not()选择器过滤器 在大多数情况下,这是一个更好的选择.
希望这有帮助,:)干杯!
| 归档时间: |
|
| 查看次数: |
188 次 |
| 最近记录: |