<body>
<div class="wrap">
<table>
<thead>
<tr>
<th>
<!-- 开始默认补选中 checked="checked" -->
<input type="checkbox" id="j_cbAll" />
</th>
<th>商品</th>
<th>价钱</th>
</tr>
</thead>
<tbody id="j_tb">
<tr>
<td>
<input type="checkbox" />
</td>
<td>iPhone8</td>
<td>8000</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>iPad Pro</td>
<td>5000</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>iPad Air</td>
<td>2000</td>
</tr>
<tr>
<td>
<input type="checkbox" />
</td>
<td>Apple Watch</td>
<td>2000</td>
</tr>
</tbody>
</table>
</div>
<script>
// 1. 实现全选和取消全选功能
// 将下面所有复选框的 checked 属性(选中状态)依附上面全选复选框即可
// 1.1 获取获取上面复选框元素对象
// 1.2 获取下面所有复选框元素对象
// 核心功能:
// 绑定事件 处理事件程序
// 难点2. 下面复选框需要全部选中,上面复选框才能被选中
// 2.1 给下面所有复选框 都要 绑定点击事件
</script>
</body>










