Count the number of checked checkboxes in HTML

后端 未结 6 900
一整个雨季
一整个雨季 2020-12-10 01:13

So basically i want to count the number of checkboxes that are ticked. I get my code to the point where it counts them successfully, but I want to put in an alert that shows

6条回答
  •  猫巷女王i
    2020-12-10 01:42

    Try this code

     
    Apples Oranges Mango
    Yes

    Javascript

         function checkboxes()
          {
           var inputElems = document.getElementsByTagName("input"),
            count = 0;
    
            for (var i=0; i

    FIDDLE DEMO

提交回复
热议问题