jQuery Plugin To Handle Checkbox States - checkbox-plus

jQuery Plugin To Handle Checkbox States - checkbox-plus
File Size: 2.64 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

checkbox-plus is a very small jQuery plugin that enables you to set and get the check states (checked, unchecked and indeterminate) of a checkbox you specify.

How to use it:

1. Put the latest version of jQuery library and the jQuery checkbox-plus plugin's script in the webpage.

<script src="jquery.min.js"></script>
<script src="jquery.checkbox-plus.js"></script>

2. Set the state of your checkbox to 'Checked'.

$("checkbox").setCheckboxStatus('1');

3. Set the state of your checkbox to 'Unchecked'.

$("checkbox").setCheckboxStatus('0');

4. Set the state of your checkbox to 'Tri-state'.

$("checkbox").setCheckboxStatus('-1');

5. Get the current state of your checkbox.

$("checkbox").getCheckboxStatus();

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