87,907
社区成员
发帖
与我相关
我的任务
分享
<html xmlns="http://www.w3.org/1999/xhtml ">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<title></title>
<script type="text/javascript">
jQuery(function($) {
$("table").each(function(i){
$(this).find(":checkbox:first").click( function () {
$("table").eq(i).find(":checkbox").attr("checked",$(this).attr("checked"));
});
});
});
</script>
</head>
<body>
<form id="form">
<table id="appoint1630" class="table">
<thead>
<tr class="header">
<td><div><input class="cba" type="checkbox"></div></td>
</tr>
</thead>
<tbody class="tbody">
<tr id="appoint1630_row1" class="odd" >
<td><input name="id" type="checkbox"></td>
</tr>
<tr id="appoint1630_row2" class="odd" >
<td><input name="id" type="checkbox" ></td>
</tr>
</tbody>
</table>
<table id="appoint1631" class="table">
<thead>
<tr class="header">
<td><div><input class="cba" type="checkbox"></div></td>
</tr>
</thead>
<tbody class="tbody">
<tr id="appoint1631_row1" class="odd" >
<td><input name="id" type="checkbox"></td>
</tr>
<tr id="appoint1631_row2" class="odd" >
<td><input name="id" type="checkbox"></td>
</tr>
</tbody>
</table>
</form>
</body>
</html>
$("table:eq(0) :checkbox").attr("checked","checked");