Javascript Function to Select or Unselect All Checkboxes

You can use the following code to check or Uncheck the checkboxes in the form. otherwise Select or Unselect the checkboxes in the form.You can use any number of checkboxes for selection, you can use this for both check and uncheck by selecting  a single checkbox.

Code to Check or Uncheck the checkboxes