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