实时计数选中的复选框,而无需在html5中提交或执行任何其他操作

I´m doing a management page for a learning institute as a homework of programming languages subject, and I need to make an assistance database and its frontend. I made a table with students IDs, names and a column with checkboxes that you checked if that student is present. I want to count the number of present students, let´s say, on-the-fly. I have found a lot of examples that counts checkboxes when you clicked a buttom or something like that like this ->Count checkboxes..., but I need another thing. I want to show that number as I checked boxes in "realtime" without clicking another thing, in a text below like 'Total students Present: "n"', and n changes as you check each box. I will be very greatful with any sugestion or tip.


sorry i forget that, yes i used pure vainilla javascript, i will try this. thank you so much for your answer