Select none for all Jq traversal and select all jq
// Select all $ ('# checkall '). click (function () {// determine if var bischecked is selected = $ ('# checkall '). is (': checked'); var fruit = $ ('input [name = "check"]'); bischecked? Fruit. attr ('checked', true): fruit. attr ('checked', false) ;}); // returns the checkbox traversal result. If the checkbox is selected, it is set to deselected. Otherwise, it is the same $ ("# tabVouchList tr "). each (function () {if ($ ("td: eq (0) input [name = 'check']", $ (this )). is (': checked') {$ (this ). attr ('checked', false);} else {$ (this ). attr ('checked', true );}});
HTML table
<Table id = "tabVouchList"> <tr> <th> <input type = "checkbox" name = "checkAll"/> </th> <th> row number </th> <th> name </th> </tr> <td> <input type = "checkbox" name = "check"/> </td> <td> row number </td> <td> name </td> </tr> </table>