Example is given below. To check whether a checkbox is checked, try to run the following code. Demo Download. You can check this using the appropriately named .type attribute. Loop all checkboxes and set checked to true when Check all checkbox checked state is TRUE otherwise set all checkboxes checked state to FALSE. TAGs: JavaScript, CheckBox This Javascript function will check or uncheck all the checkboxes in an HTML form. jQuery¶.