How to check or uncheck checkbox using jQuery

check or uncheck checkbox using jquery

Here is the simple way to check and uncheck checkbox button using jQuery.

check or uncheck checkbox using jquery

1. The example below show that.. on change dropdown option of field.. all the check-boxes will be unchecked .

jQuery('#nst').change(function(){	
  
 jQuery('input:checkbox').each(function() {
   this.checked = false;
 });
});
  

2. The example below show that.. on change dropdown option of field.. all the check-boxes will be checked .

jQuery('#nst').change(function(){	
  
 jQuery('input:checkbox').each(function() {
   this.checked = true;
 });
});
  

checkbox checked

You can use this individually or instead of change function… you can use click function too… as per you need.

Drop a message if you need more help..

Thanks 🙏

If this help you then.. Can you buy a Cup of Coffee for me by nst webcreation paypal--OR-- nst webcreation blog coffee cup

Published by

NST

Myself Narender Singh Thakur ( NST ) and i share my Experience/Knowledge and Tricks for folks and beginners to solve their issues while making websites through this Planet.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Click to Chat