Search
 
SCRIPT & CODE EXAMPLE
 

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;
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript lowercase string except first letter of every word if there are ' 
Javascript :: format date month day year javascript 
Javascript :: global error handling middleware express 
Javascript :: mongoose query if field exists where filed exists 
Javascript :: javascript change hidden input value 
Javascript :: get file extention js 
Javascript :: discord.js find role by name 
Javascript :: prime number js 
Javascript :: javascript date time formating 
Javascript :: duplicates array js 
Javascript :: js doubly linked list 
Javascript :: javascript cookie expire in 5 minutes 
Javascript :: Arrays Comparison 
Javascript :: scrollbar automatically scroll down as new divs are added reactjs 
Javascript :: html javascript type 
Javascript :: btn.addeventlistener 
Javascript :: Use History React Router v5 app 
Javascript :: get placeholder innerhtml 
Javascript :: js read from json 
Javascript :: Both npm and yarn have created lockfiles for this application, but only one can be used to install dependencies. 
Javascript :: On click, disable button 
Javascript :: put 0 in front of month number javascript 
Javascript :: js url 
Javascript :: javascript - get the filename and extension from input type=file 
Javascript :: js remove property from object 
Javascript :: check value exist in array javascript 
Javascript :: javascript round to 1 decimal 
Javascript :: ionic cordova icon notification 
Javascript :: reverse every word 
Javascript :: using iframe in chrome console 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =