Home > jQuery > How To Set A Checkbox To Checked in jQuery
Bookmark and Share

How To Set A Checkbox To Checked in jQuery

Posted on March 24, 2018 | Filed in jQuery

There are a few ways of setting a checkbox to checked. If you are using jQuery 1.6 and greater, then you should use:

jQuery(element).prop('checked', true);

Since the .prop method did not exist prior to 1.6, you should use:

jQuery(element).attr('checked', true);

Leave a Reply