javascript - How to check if at least one checkbox is checked from list of checkboxes with it name attribute as array -
i have div , inside div have check boxes name attribute array, want heck if @ least 1 check box checked.
<div id="check_lists">   <input type="checkbox" name="usernames[]" value="1">  <input type="checkbox" name="usernames[]" value="2">  <input type="checkbox" name="usernames[]" value="3">  <input type="checkbox" name="usernames[]" value="3">  </div> 
you can use attribute equals selector .is() , :checked-selector
if($('input[name="usernames[]"]').is(':checked')){     //at least 1 checked } 
Comments
Post a Comment