Try this
jQuery solution:
var len = $(":checked",$("input[name='cbox[]']")).size();
jQuery solution:
var len = $("[name='cbox[]']:checked").length;
JavaScript solution:
var len = [].slice.call(document.querySelectorAll("[name='cbox[]']"))
.filter(function(e) { return e.checked; }).length;
$('input:checked').length
will do if you do not have any other input tags than in this form.
Try out,
var boxes = $('input[name="cbox[]"]:checked');
find how many are checked,
$(boxes).size();
or
$(boxes).length();
you also do by this
you have to define class for checkBox and then follow below
var chkLength = $('input.className:checked').length; alert(chkLength);
this will print your total no of checkboxes from list
Doing it with jQuery would shorten the code and make it more readable, maintainable and easier to understand. Use attribute selector with :checked selector
Live Demo
$('[name="cbox[]"]:checked').length