Check All Checkboxes With Pure JavaScript – check.js

Category: Form , Javascript | February 9, 2018
Author: zulkarneynyavas
Views Total: 2,217
Official Page: Go to website
Last Update: February 9, 2018
License: MIT


Check All Checkboxes With Pure JavaScript – check.js


check.js is a dead simple JavaScript library that provides a SelectAll function to check and uncheck all the related checkboxes with just one click.

How to use it:

Create a ‘Check All’ checkbox on the web page.

<input type="checkbox" name="CheckAll" onclick="SelectAll()" />Select All

Add the name="CheckBox" attribute to the all children checkbox inputs as these:

<input type="checkbox" name="CheckBox" value="checkbox1" />
<input type="checkbox" name="CheckBox" value="checkbox2" />
<input type="checkbox" name="CheckBox" value="checkbox3" />

Download and insert the check.js script into the document. Done.

<script src="check.js"></script>

You Might Be Interested In:

Leave a Reply