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