Jquery checkbox: select all, deselect all, and select method 3.

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.