<script>
function test() {
var oInput = document.getElementsByTagName("input");
var count = 0;
for(var i in oInput) {
   if(oInput[i].getAttribut("type") == "checkbox") {
       if(oInput[i].checked) {
           count ++; 
        }
   }
}
return count;
}
</script>