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

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -