Is there a way to determine if a checkbox is checked using JavaScript?
I have multiple dynamic checkboxes and I need help figuring out how to check if the number of checked checkboxes is greater than or equal to '1' using JavaScript.
<input type="checkbox" id="1" name="test[]" onclick="test_fn()"/>
<input type="checkbox" id="2" name="test[]" onclick="test_fn()"/>
<input type="checkbox" id="3" name="test[]" onclick="test_fn()"/>
<input type="checkbox" id="4" name="test[]" onclick="test_fn()"/>
<script>
function test_fn() {
// Need to implement code to check for checked checkboxes //
}
</script>