How to check and uncheck a html checkbox using JQuery

No Comments

We will use a checkbox with ID “myCheckbox” in this example

First to check a checkbox using JQuery use the following code, remember to replace “myCheckbox” with the ID of your checkbox

$('#myCheckbox').attr('checked','checked');

To un-check the checkbox use the following JQuery code, remember to replace “myCheckbox” with the ID of your checkbox

$('#myCheckbox').removeAttr('checked');

Image Credits: Photo by Isis França on Unsplash.

Last Updated On March 21, 2018

Related Articles

No results found

Leave a Reply

avatar
  Subscribe  
Notify of
Menu
Copy link