Copy Code code as follows:
<script src= "Http://img.jb51.net/jslib/jquery/jquery-1.3.2.min.js" ></script>
<input type= "checkbox" Name= "checkbox_name[]" id= "checkbox_name_1″/>1<br/> <input type=" checkbox " Name= "checkbox_name[]" "id=" checkbox_name_2″/>2<br/>
<input type= "checkbox" Name= "checkbox_name[" id= checkbox_name_3″/>3<br
<input type= "checkbox" Name= "checkbox_name[" id= checkbox_name_4″/>4<br
<input type= "checkbox" Name= "Checkedall" id= "Checkedall"/> Select All/Cancel All selection
<script type= "Text/javascript" ><!--
$ (function () {
$ ("#checkedAll"). Click (function () {
if ($ (this). attr ("checked") = = True) {//Select all
$ ("Input[name= ' checkbox_name[]"). each (function () {
$ (this). attr ("Checked", true);
});
else {//Cancel all selections
$ ("Input[name= ' checkbox_name[]"). each (function () {
$ (this). attr ("checked", false);
});
}
});
});
-->
</script>