jQuery Plugin To (un)Select All The Checkboxes By One Click - tCheckAll

File Size: 7.76 KB
Views Total: 1290
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery Plugin To (un)Select All The Checkboxes By One Click - tCheckAll

tCheckAll is a dead simple jQuery plugin which allows you select and un-select all the checkboxes by one click.

See also:

How to use it:

1. Load the jQuery tCheckAll script after jQuery javascript library.

<script src="/path/to/cdn/jquery.min.js"></script>
<script src="/path/to/jquery.tcheckall.min.js"></script>

2. Create a 'select all' link (or button) for a list of checkboxes.

<form id="demo">
  <fieldset>
    <a href="javascript:void(0)" id="all"> Select All</a>
    <input type="checkbox" name="number[]" value="1" />
    Value 1
    <input type="checkbox" name="number[]" value="1" />
    Value 2
    <input type="checkbox" name="number[]" value="1" />
    Value 3
    ...
  </fieldset>
</form>

3. Call the plugin on the 'select all' link.

$(document).ready(function() {
  $('#all').tCheckAll();      
});

4. Available plugin options.

$('#all').tCheckAll({
  checkTxt: 'Check',
  unckeckTxt: 'Uncheck',
  cheked: true,
});

Changelog:

v2 (2023-03-14)

About Author:

Author: @berumen

Website: http://berumen.pw 


This awesome jQuery plugin is developed by berumen. For more Advanced Usages, please check the demo page or visit the official website.