Reputation: 12621
I have below html table.
<table>
<tr>
<td>
Delete:<br><input type="checkbox" id="deleteCheckOne" class="deleteCheck" name="delete" value="0">
</td>
<td>
Delete:<br><input type="checkbox" id="deleteCheckTwo" class="deleteCheck" name="delete" value="0">
</td>
</tr>
</table>
Now using JQuery i have to find the checked
count of the class deleteCheck
using JQuery.
How can i fine the count of number of checked checked boxes using JQuery>
Thanks!
Upvotes: 0
Views: 506
Reputation: 121998
Use the selector
$('input:checkbox:checked.deleteCheck').length;
Upvotes: -1
Reputation: 23801
Checked rows can be selected by :checked
and length
gives you the count hence,this would help
$('.deleteCheck:checked').length;
Upvotes: 0
Reputation: 337560
You can use the :checked
selector to only find the checked
inputs, and the length
property to find out out many there are.
var checkedCount = $('.deleteCheck:checked').length;
Upvotes: 1