finding all checkboxes that are NOT checked

If I wanted to select all checkboxes that are selected, I could do this.

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

Is there a similarly simple syntax that lets me select all the checkboxes that are NOT selected?

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, it is a better choice.

Hope this helps, :) cheers!


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

You won't believe it.

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

EDIT: Stackoverflow management, whats going on with the nuts CAPTCHA? Every single answer today requires me to enter a CAPTCHA code?


Need Your Help

Will iOS show popups to update to latest iOS?

ios ios5 ios6

We have developed a kiosk type of app with iOS 5.1.1. Now that iOS 6 is out I'm wondering if Apple will randomly show a popup to update to iOS 6? Obviously we don't want to update just yet and don'...

ios UIview in views

objective-c ios

I have a uiview that has all my buttons, that has its controller. How can I include the button view in all my uiviews using the interface builder? The buttons must work when click. The purpose is to