Find all flags that are NOT checked

If I wanted to select all the checkboxes that were selected, I could do it.

$('#mydiv input[type=checkbox]:checked')

Is there a similar simple syntax that allows me to select all the checkboxes that are NOT selected?

+3
source share
3 answers

Hiya yep: demo http://jsfiddle.net/usvrb/

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

quote

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

selector filter. In most cases, this is the best choice.

Hope this helps :) cheers!

+6
source
 $('#mydiv input[type=checkbox]:not(:checked)')
+3
source

You will not believe.

$('#mydiv input[type=checkbox]').not(':checked')

EDIT : Stackoverflow management, what happens to CAPTCHA nuts? Today, every answer requires me to enter the CAPTCHA code?

+2
source

All Articles