-3

I want to get the count of checked check Boxes form below code sample, enter image description here

Thnks, Digambar K.

5 Answers5

2

First of all, please post the actual code in 'code' tags, so this will appear in search results and can be of help for future people looking for the same issue.

Also, a little googling would have found you the answer right away:

$("input[type=checkbox]:checked").length
Praxis Ashelin
  • 5,137
  • 2
  • 20
  • 46
1

You need to count all checkboxes from a page?

If yes:

$('input[type=checkbox]:checked').length

If you want to count just checkbox inside the table:

$('table input[type=checkbox]:checked').length
Guerra
  • 2,792
  • 1
  • 22
  • 32
1

Try this,

$(function(){
    alert($('table').find('input[type="checkbox"]:checked').length)   
});
Rohan Kumar
  • 40,431
  • 11
  • 76
  • 106
1

Keep it simple and stupid!

Try something like this:

// count all checkboxes
var count = $(":checkbox").length();

// count all checkboxes checked
var countChecked = $(":checkbox:checked").length();
Felipe Oriani
  • 37,948
  • 19
  • 131
  • 194
0

Will give you all the checked inputs inside the table

$('.ms-input input[type=checkbox]:checked').length
Tomzan
  • 2,808
  • 14
  • 25