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-10td>
<td>2020-10-20td>
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-10td>
<td>2020-10-20td>
tr>
tbody>
table>
<div id="page-master">div>
div>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44