Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check if at least one checkbox is checked

//JavaScript
const atLeastOneCheckboxIsChecked = document.querySelectorAll('input[type="checkbox"]:checked').length > 0;

//jQuery
const atLeastOneCheckboxIsChecked = $('input[type="checkbox"]:checked').length > 0;
 
PREVIOUS NEXT
Tagged: #check #checkbox #checked
ADD COMMENT
Topic
Name
3+9 =