I\'m having trouble figuring this out. I have two checkboxes (in the future will have more):
checkSurfaceEnvironment-1
checkSurface
You can also use either jQuery .not() method or :not() selector:
if ($('#checkSurfaceEnvironment').not(':checked').length) {
// do stuff for not selected
}
JSFiddle Example
From the jQuery API documentation for the :not()
selector:
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.