. Select the row - {
Background - color: # 4 eb305;
color: #fff;
}
Selection & lt; Input type='checkbox' id="allChecked & gt;" |
The serial number & lt;/th>
| Name & lt;/th>
| The type & lt;/th>
| Unified coding & lt;/th>
| Code & lt;/th>
| Affiliation & lt;/th>
| Founder & lt;/th>
| Creation date & lt;/th>
| Revised one & lt;/th>
| The revision date & lt;/th>
|
<script>
$(' # orgTable tbody ') on (' click ', 'tr', function () {
$(this). ToggleClass (' select - row);
Var checkboxs=$(this). The find (" input: the checkbox ");
If ($(this). HasClass (" select - row ")) {
$(checkboxs [0]). Prop (" checked ", true);
} else {
$(checkboxs [0]). Prop (" checked ", false);
}
});
$(" # allChecked "). Change (function (e) {
//to determine whether a state is selected
If ($(e.c. with our fabrication: urrentTarget). Prop (" checked ")) {
$(' # orgTable tbody tr input: the checkbox '), prop (" checked ", true);
$(' # orgTable tbody tr '). The addClass (" select - row ");
} else {
$(' # orgTable tbody tr input: the checkbox '), prop (" checked ", false);
$(' # orgTable tbody tr '). RemoveClass (" select - row ");
}
});
<script>
ToggleClass why doesn't work here, and how to modify is white white
CodePudding user response:
Table from the database query dynamically generated content, click the check box, how to choose is white white, solving
CodePudding user response:
Check & lt; tbody> The tag format right, isn't it & lt; tr> Nested & lt; td>
CodePudding user response:
Didn't write anything at the beginning, just tried it on, it is of little use if
CodePudding user response:
Didn't write anything at the beginning, just tried it on, as if it's no use
CodePudding user response: