0
的长度,我不想再重复jQuery的接受检查列表,而不是检查列表和复选框
jQuery("#checkboxList input:checkbox:checked").length
jQuery("#checkboxList input:checkbox:checked")
jQuery("#checkboxList input:checkbox:not(:checked)")
我希望有一个更优雅的solution.Where我只能通过checked
,not checked
,length
PARAMS获得预期的结果。就像这样:
var checkboxList = jQuery("#checkboxList input:checkbox");
checkboxList.get(":checked")
checkboxList.get(":not(:checked)")
checkboxList.get(":checked").length
<div id="checkboxList">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
</div>