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

Source: Internet
Author: User

recently work is writing jquery, in fact I did not learn the system JS, today to share with you a recent write about the check box batch processing.

<! DOCTYPE html> The check box here batch processing is the delete operation. When the Select All button is selected, the other checkboxes are all selected, and the Select all check box is generally used in the list, and all columns of the list are selected. If you remove one of the lines in the list after the check box is selected, the Select all check box is selected. When you click the "Delete selected" button, you want to delete the row where the check box is selected.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 have a brief reference.


Author: Li Li
Sign: Life does not have too many illusions, but to have more action.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

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.