JQUERYCHECKBOX all selected, cancel all selected, invert method 3 _ jquery

Source: Internet
Author: User
Recently, I have been studying JQUERY's CHECKBOX. I have already introduced the full selection and cancellation of the CHECKBOX. Now I will continue to share with you the third method. At the same time, I can implement the inverse selection and specified selection of the CHECKBOX, of course, we must first download jquery.checkboxes.zip and decompress and reference it 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 give everyone a better understanding, I directly paste the code that implements the function:

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.