abstract:<!DOCTYPE html> <html> <head> <title> 全选 </title> <style type="text/css"> *{padding:0px;margin: 0px;} table{width:1200px;border:1p
<!DOCTYPE html> <html> <head> <title> 全选 </title> <style type="text/css"> *{padding:0px;margin: 0px;} table{width:1200px;border:1px solid #ccc;border-collapse: collapse;} tr th{height:30px;border:1px solid #ccc;text-align:} tr td{height:30px;border:1px solid #ccc;text-align: center;} .text-a{font-family: 黑体;font-size: 18px;} .text-b{font-family: 宋体;font-size: 15px;} .tj{text-align: right;} button{margin-right: 10px;} </style> <script type="text/javascript"> function checkall(){ var checkall,item; checkall=document.getElementById('checkall'); //获取全选框 item=document.getElementsByName("item[]")//获取单选框 for (var i = 0;i<item.length;i++) { if(checkall.checked){ item[i].checked=true; //全选被选中的时候,单选也就被选中了。 }else{ item[i].checked=false; } } } </script> </head> <body> <center> <table> <tr class="text-a"> <th width="80"><input type="checkbox" id="checkall" onclick="checkall()"><label for="checkall">全选</label></th> <th width="70">姓 名</th> <th width="40">性别</th> <th width="80">部门</th> <th width="120">联系电话</th> <th width="200">EMAIL地址</th> <th width="220">合同周期</th> <th width="130">项目组</th> <th width="70">状态</th> <th width="">其他</th> </tr> <tr class="text-b"> <td><input type="checkbox" name="item[]"></td> <td>令狐无忌</td> <td>男</td> <td>底盘</td> <td>13900000000</td> <td>13900000000@163.com</td> <td>2017-01-01至2018-12-31</td> <td>F111</td> <td>在职</td> <td></td> </tr> <tr class="text-b"> <td><input type="checkbox" name="item[]"></td> <td>虚竹</td> <td>男</td> <td>CAE</td> <td>13903300044</td> <td>13903300044@163.com</td> <td>2017-01-01至2018-12-31</td> <td>H987</td> <td>在职</td> <td></td> </tr> <tr class="text-b"> <td><input type="checkbox" name="item[]"></td> <td>长孙冲</td> <td>男</td> <td>电器</td> <td>13900000002</td> <td>13900000002@163.com</td> <td>2017-01-01至2018-12-31</td> <td>S431</td> <td>在职</td> <td></td> </tr> <tr> <td></td> <td colspan="10" class="tj"> <button>提交</button><button>重置</button> </td> </tr> </table> </center> </body> </html>
Correcting teacher:灭绝师太Correction time:2018-12-18 09:23:58
Teacher's summary:棒棒的!学以致用了,一句终于可见是花了功夫的,继续加油!