Jquery.checkboxes.zip, decompress and reference to the page using the plug-in,
You don't need to talk about this! Let's take a look at the specific example below. In order to make everyone better understand, I directly implement the function Code Post it:
Copy code The Code is as follows: $ ("# myform"). togglecheckboxes () // select all. deselect all and select inverse.
$ ("# Myform"). togglecheckboxes (": Not (# checkbox1)") // select all. uncheck all and the first one.
$ ("# Myform"). togglecheckboxes (". top5", true) // select all. deselect all and select only the first five.
$ ("# Myform"). checkcheckboxes (); // select all
$ ("# Myform"). checkcheckboxes (": Not (# checkbox1)"); // select all except the first one.
$ ("# Myform"). checkcheckboxes (". top5", true); // select all the first five
$ ("# Myform"). uncheckcheckboxes (); // cancel all selections
$ ("# Myform"). uncheckcheckboxes (": Not (# checkbox1)"); // deselect all to exclude the first
$ ("# Myform"). uncheckcheckboxes (". top5", true); // cancel all selection to exclude the first five
Here, checkbox1 indicates the id value and top5 indicates the class value! I will introduce it here. If you are interested, you can download and use it yourself. You can also take a look at the official demo!
: Http://plugins.jquery.com/files/jquery.checkboxes.zip
Demo address: http://www.texotela.co.uk/code/jquery/checkboxes/
Please share your suggestions or good methods. Thank you!