lundi 27 avril 2020

jQuery : How can I count total checked boxes per column in a table?

I have a table with checkboxes like this :

| First | Second | Third |
|  [x]  |   [ ]  |  [x]  |
|  [x]  |   [x]  |  [ ]  |
|  [x]  |   [x]  |  [ ]  |

I'd like to count the totals of checked boxes per column, so I can display them for each column, like so :

| First | Second | Third |
|  [x]  |   [ ]  |  [x]  |
|  [x]  |   [x]  |  [ ]  |
|  [x]  |   [x]  |  [ ]  |
--------------------------
|   3   |    2   |   1   |



Aucun commentaire:

Enregistrer un commentaire