jQuery中的prop方法(全选按钮)
prop方法
全选按钮
<script>
$("#checkAll").click(function () {
$("#tBody input[type='checkbox']").prop("checked", this.checked);
});
</script>
<div style="position: relative;top: 10px;">
<table class="table table-hover">
<thead>
<tr style="color: #B3B3B3;">
<td><input type="checkbox" id="checkAll"/></td>
<td>名称</td>
<td>所有者</td>
<td>开始日期</td>
<td>结束日期</td>
</tr>
</thead>
<tbody id="tBody">
<tr class="active">
<td><input type="checkbox" /></td>
<td><a style="text-decoration: none; cursor: pointer;" onclick="window.location.href='detail.html';">发传单</a></td>
<td>哈哈</td>
<td>2020-10-10</td>
<td>2020-10-20</td>
</tr>
<tr class="active">
<td><input type="checkbox" /></td>
<td><a style="text-decoration: none; cursor: pointer;" onclick="window.location.href='detail.html';">发传单</a></td>
<td>嘿嘿</td>
<td>2020-10-10</td>
<td>2020-10-20</td>
</tr>
</tbody>
</table>
<div id="page-master"></div>
</div>