each(function(index, element){ if(! element. checked){ allChecked = false; return false; } });
Show activity on this post. for(var i = 0; i < values. length; i++) $("#list [value=" + values[i] + "]"). attr("checked", "checked");
Checking if a checkbox is checked First, select the checkbox using a DOM method such as getElementById() or querySelector() . Then, access the checked property of the checkbox element. If its checked property is true , then the checkbox is checked; otherwise, it is not.
I have a collection of checkboxes
<input id="1" class="paid" type="checkbox" /> <input id="2" class="paid" type="checkbox" /> <input id="3" class="paid" type="checkbox" /> <input id="4" class="paid" type="checkbox" />
I would like to write some jQuery to check if all checkboxes are checked then perform an action but how?
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