<! DOCTYPE html>
<meta charset= "UTF-8" >
<title>Title</title>
<body>
<input type= "button" value= "Select All" onclick= "Checkall ();"/>
<input type= "button" value= "Cancel" onclick= "Cancleall ();"/>
<input type= "button" value= "reverse select" onclick= "Reverall ();"/>
<table border= "1" >
<thead>
<tr>
<th> Options </th>
<th>IP</th>
<th>PORT</th>
</tr>
</thead>
<tbody id= "I1" >
<tr>
<td><input type= "checkbox"/></td>
<td>1.1.1.1</td>
<td>22</td>
</tr>
<tr>
<td><input type= "checkbox"/></td>
<td>2.2.2.2</td>
<td>2222</td>
</tr>
<tr>
<td><input type= "checkbox"/></td>
<td>3.3.3.3</td>
<td>3333</td>
</tr>
<tr></tr>
</tbody>
</table>
<script src="jquery-1.12.4.js"></script><script> function checkALL() { $(‘#i1 :checkbox‘).prop(‘checked‘,true); } function cancleALL() { $(‘#i1 :checkbox‘).prop(‘checked‘,false) } function reverAll() { $(‘#i1 :checkbox‘).each(function (k) { console.log(k) if($(this).prop(‘checked‘)){ $(this).prop(‘checked‘,false); }else { $(this).prop(‘checked‘,true); }
if (this.checked) {
this.checked = false;
}else {
This.checked = true;
// }
}) }</script>
</body>
jquery implementation of the full selection of anti-selection function page