PHP bulk operation of the table, such as the Select all anti-select Delete function

Source: Internet
Author: User

<! doctype>table{Border:#999 1px solid;Border-collapse:collapse; } table th{Text-align:Center; } Table td{Border: 1px solid#999;Text-align:Center; }        .one{Background:#6CF;        }        .two{Background:#Fc6;        }    </style> <script type= "Text/javascript" language= "JavaScript" >functionChangeColor () {varTr=document.getelementsbytagname ("tr"); tr[0].style.background= "#0066ff"; Tr[tr. length-1].style.background= "#0066ff"; }        functionChangebox (type) {varTBS = document.getElementById ("TBS"); varCHKS = tbs.getelementsbytagname ("Input"); Switch(type) { Case"QX": for(vari = 0; i < chks.length; i++) {Chks[i]. checked =true; }                     Break;  Case"Qxx": for(vari = 0; i < chks.length; i++) {Chks[i]. checked =false; }                     Break;  Case"FX": for(vari = 0; i < chks.length; i++) {                        if(chks[i].checked = =true) {Chks[i]. checked =false; } Else{Chks[i]. checked =true; }                    }                     Break; }        }        functiondel () {varInput=document.getelementsbyname ("check["));  for(varI=input.length-1; i>=0; i--){                if(input[i].checked==true){                    varTd=input[i].parentnode; varTr=td.parentnode; varTable=tr.parentnode; Table.removechild (TR); }            }        }    </script>class= "One" > <td><input type= "checkbox" Name= "check[" "></td> <td> Wang Dali </td> <td>[email protected]</td> <td> personal email </td> </tr> <trclass= "Both" > <td><input type= "checkbox" Name= "check[" "></td> <td> Wang Dali </td> <td>[email protected]</td> <td> personal email </td> </tr> <trclass= "One" > <td><input type= "checkbox" Name= "check[" "></td> <td> Wang Dali </td> <td>[email protected]</td> <td> personal email </td> </tr> <trclass= "Both" > <td><input type= "checkbox" Name= "check[" "></td> <td> Wang Dali </td> <td>[email protected]</td> <td> personal email </td> </tr> <trclass= "One" > <td><input type= "checkbox" Name= "check[" "></td> <td> Wang Dali </td> <td>[email protected]</td> <td> personal email </td> </tr> <trclass= "Both" > <td><input type= "checkbox" Name= "check[" "></td> <td> Wang Dali </td> <td>[email protected]</td> <td> personal email </td> </tr> <trclass= "One" > <td><input type= "checkbox" Name= "check[" "></td> <td> Wang Dali </td> <td>[email protected]</td> <td> personal email </td> </tr> <tr> <th> Options </ Th> <td colspan= "3" align= "center" > <input type= "button" id= "QX" onclick= "Changebox (' qx ')" value= "Select All "> <input type=" button "id=" Qxx "onclick=" Changebox (' Qxx ') "value=" deselect All "> <input type=" button "I     D= "FX" onclick= "Changebox (' FX ')" value= "Reverse Selection" > <input type= "button" id= "del" onclick= "del ()" value= "Delete selected accessory" > </td> </tr> </tbody></table></body>

PHP bulk operation of the table, such as the Select all anti-select Delete function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.