How do you check or uncheck a checkbox input or radio button?

Answer

There are two ways to check or uncheck a checkbox or radio button.

Set the 'checked' attribute to true or false.

 // Check #pcds
 $('#pcds').attr('checked', true);
 // Uncheck #pcds
 $('#pcds').attr('checked', false);

Add or remove the 'checked' attribute:

 // Check #pcds
 $("#pcds").attr('checked', 'checked');
 // Uncheck #pcds
 $("#pcds").removeAttr('checked');

All JQUERY Questions

Ask your interview questions on jquery

Write Your comment or Questions if you want the answers on jquery from jquery Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---