Reputation: 17
to be short : i want to select all the 'checked' checkboxes in my page except one of them !
so i tried this :
$('input:checkbox').not('#SpecificChbx').is(':checked')
i've tried this too :
$('input:checkbox:not(#SpecificChbx)').is(':checked')
i've tried so many alternatives but still not working .. any help please ?
this is a jsfiddle example
Upvotes: 0
Views: 42
Reputation: 9031
.is
returns true or false (if one of the matches checkboxes is checked it will return true, else false), what you want is a jQuery collection: $('input:checkbox:checked:not(#SpecificChbx)')
Upvotes: 6
Reputation: 55750
You need to iterate over them...
$('input:checkbox').not('#SpecificChbx').filter(function () {
return $(this).is(':checked');
}).each(function () {
// Whatever you want here
});
Upvotes: 1