全選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部分代碼,實現(xiàn)以下效果及功能。
JS功能:
??①當勾選全選復選框時,下方所有復選框全部勾選。取消勾選全選復選框時,下方所有復選框全部取消勾選。
②當下方復選框全都勾選時,勾選全選復選框。當下方復選框任意一個未勾選時,取消勾選全選復選框。
