Bulk processing of the JQuery check box: Select All, not select all

Source: Internet
Author: User

Recent work is writing jquery, in fact, I did not learn JS system. Today, I would like to share with you a recent batch of check boxes.

<! DOCTYPE html> The check box here batch processing is the delete operation. When the Select All button is selected, the other check boxes are all selected, so the Select all check box is generally used in the list, and all columns of the list are selected.

When selected, remove the check box from the list. The Select all check box is also selected. When you click the "Delete selected" button, you want to delete the row that contains the selected check box.

The following is the JQ code:
<script>$ (function () {//Select all $ (": Input[name= ' city_qx ']"). Click (function () {if ($ (this). attr ("checked") = = True) { $ (": Input[name= ' city ']"). attr ("Checked", true); else{$ (": Input[name= ' city ']"). attr ("checked", false);}) function isChecked (obj) {//Not all-Select if (obj.attr ("checked") = = False) {$ (": Input[name= ' city_qx ']"). attr ("checked", false);}} Delete function del (id,obj) {$.ajax ({///slightly})}//Delete the selected function delchecked () {$ ("input[name= ' City ']:checked"). each (function () {        del ($ (this). Val (), $ (this));    }); </script>

Let's take a few references.



Author: Li Li
Sign: Life does not have too many illusions, but there are many other actions.

Bulk processing of the JQuery check box: Select All, not select all

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.