{"id":12694,"date":"2022-10-03T15:34:18","date_gmt":"2022-10-03T19:34:18","guid":{"rendered":"http:\/\/local.brightwhiz\/?post_type=snippets&p=12694"},"modified":"2022-10-03T15:36:01","modified_gmt":"2022-10-03T19:36:01","slug":"how-to-uncheck-a-checkbox-in-jquery","status":"publish","type":"snippets","link":"http:\/\/local.brightwhiz\/snippets\/how-to-uncheck-a-checkbox-in-jquery\/","title":{"rendered":"How to Uncheck a Checkbox in jQuery"},"content":{"rendered":"\n
Use this to how to uncheck a checkbox in jQuery:<\/p>\n\n\n\n
\/\/jQuery 1.6+ use\n\n$('.checkbox').prop('checked', true); \/\/false for uncheck\n\n\/\/jQuery 1.5.x and below use\n\n$('.checkbox').attr('checked', true); \/\/false for uncheck\n\n$('#theCheckbox').prop('checked', true); \/\/ Checks it\n$('#theCheckbox').prop('checked', false); \/\/ Unchecks it<\/code><\/pre>\n\n\n\nAlternate:<\/p>\n\n\n\n
if ($("#checkBoxId").is(':checked')) {\n alert("checked");\n} else {\n alert("unchecked");\n}\n<\/code><\/pre>\n","protected":false},"comment_status":"open","ping_status":"closed","template":"","meta":[],"categories":[953,23,27,15,16],"tags":[328,333,433,471,635,638],"yoast_head":"\nHow to Uncheck a Checkbox in jQuery [Snippet]<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n