选项框_js全选反选
效果图:
代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
table {
width: 300px;
border-collapse: collapse;
margin: 100px 200px;
}
table tr {
height: 32px;
text-align: center;
}
table th {
border: 1px solid #ccc;
background-color: #008DD0;
}
table th:last-child {
width: 80px;
}
tbody tr:nth-child(n+2) {
background-color: #F0F0F0;
}
tbody td {
border: 1px solid #ccc;
text-align: left;
padding-left: 10px;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>
<