I have a list/group of checkboxes, that made by php; put in name="item[]" html property, and then follow with this:
var list = document.querySelectorAll("input[name^='item[']")
So far, works well. I need to count only the checked ones, not all like:
list.length
How can I access the values for eachone to check "checked" property or value?
Rather than looking through your list, you can go back and ask querySelectorAll
to return just the checked items:
var checkedList = document.querySelectorAll("input[name^='item[']:checked")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With