找到未选中的所有复选框

sam*_*old 3 javascript jquery

如果我想选择所有选中的复选框,我可以这样做.

$('#mydiv input[type=checkbox]:checked')
Run Code Online (Sandbox Code Playgroud)

是否有类似的简单语法,让我选择所有未选中的复选框?

Tat*_*nit 6

Hiya是的: 演示 http://jsfiddle.net/usvrb/

http://api.jquery.com/not-selector/

引用

  The .not() method will end up providing you with more readable selections than pushing complex selectors or variables into a :not()
Run Code Online (Sandbox Code Playgroud)

选择器过滤器 在大多数情况下,这是一个更好的选择.

希望这有帮助,:)干杯!