全选or!全选_事件的叠加20230719
有趣的装置
<html>
<table ___________①______________>
<thead>
<th>全选____②___<input type="checkbox" id="all_check" ___________③______________/> </th>
<th>部門</th><th>名前</th>
</thead>
<tbody>
<tr>
<td><input type="checkbox" name="rowCheck" __________④_______________/></td>
<td>開発1部</td>
<td>田中</td>
</tr>
<tr>
<td><input type="checkbox" name="rowCheck" ___________⑤______________/></td>
<td>開発2部</td><td>佐藤</td>
</tr>
<tr>
<td><input type="checkbox" name="rowCheck" ___________⑥______________/></td>
<td>開発2部</td><td>田島</td>
</tr>
</tbody>
</table>
<script>
___________⑦______________
</script>
</html>
请补全上方JS部分代码,实现以下效果及功能。
JS功能:
①当勾选全选复选框时,下方所有复选框全部勾选。取消勾选全选复选框时,下方所有复选框全部取消勾选。
②当下方复选框全都勾选时,勾选全选复选框。当下方复选框任意一个未勾选时,取消勾选全选复选框。
