Select all checkboxes with jQuery

So you have a form on your web site and you want to add a way for a user to select all checkboxes for one of your questions in the form. Here’s an easy way to do just that using jQuery. Use the Javascript and HTML code below.

HTML and Javascript code with the function that will make this work:

Remember that the checkbox’s “class” have to all be the same for those checkboxes that you want to check with the function. In this example the class is “checkboxClass”.