1function checkboxes(){
2 var inputElems = document.getElementsByTagName("input"),
3 count = 0;
4 for (var i=0; i<inputElems.length; i++) {
5 if (inputElems[i].type === "checkbox" && inputElems[i].checked === true){
6 count++;
7 alert(count);
8 }
9}}