특정 클래스를 제외한 체크된 모든 수를 가져오기 예제
-- HTML
<input type="button" id="ok" value="click">
<div id ="list">
<input type="checkbox" class="a b"/>
<input type="checkbox" class="a b"/>
<input type="checkbox" class="a c"/>
</div>
<div>
list:::<span id="aaa"></span></br>
checked:::<span id="bbb"></span></br>
checked but not b:::<span id="ccc"></span></br>
-- Script
$(document).ready(function(){
$('#ok').click(function(){
$('#aaa').text($('#list').size());
$('#bbb').text($('.a:checked','#list').size());
$('#ccc').text($('.a:checked:not(.b)','#list').size());
});
});
-- Result
list:::1
checked:::2
checked but not b:::1
checked:::2
checked but not b:::1