<script language="javascript">
$(function(){
$("#checkAll").click(function () {
$("input[name='checkAll2']").each(function () {
if (this.checked) {
this.checked = false;
} else {
this.checked = true;
}
});
});
$("#checkAll2").click(function () {
$("input[name='checkAll1']").each(function () {
if (this.checked) {
this.checked = false;
} else {
this.checked = true;
}
});
});
})
</script>
<table>
<tr><td><input type="checkbox" name="checkAll1" id="checkAll1"></td></tr>
<tr><td><input type="checkbox" name="checkAll2" id="checkAll2"></td></tr>
</table>