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
This should do the trick:
alert(document.querySelectorAll('input[type="checkbox"]:checked').length);