<! DOCTYPE html>
<meta charset= "Utf-8" >
<title></title>
<script src= "Jquery-1.8.3.js" ></script>
<body>
<input type= "checkbox" class= "All" > select All/Select All
<br>
<input type= "checkbox" class= "un" > Reverse selection
<div id= "Main" >
<input type= "checkbox" > Basketball
<br>
<input type= "checkbox" > Badminton
<br>
<input type= "checkbox" > Table Tennis
<br>
<input type= "checkbox" > Soccer
<br>
<input type= "checkbox" > Rugby
<br>
<input type= "checkbox" > Baseball
</div>
</body>
<script type= "Text/javascript" >
Select All and no elections
$ ('. All '). Click (function () {
$ (' #main input '). attr (' checked ', this.checked);
});
Inverse selection
$ ('. Un '). Click (function () {
$ (' #main input '). each (function () {
this.checked=!this.checked; To reverse the selection
});
});
</script>
Full selection, all-in-Select, inverse selection (CheckBox) with jquery