Favorites, contrast the JS part of the function to implement code _JAVASCRIPT skills

Source: Internet
Author: User

<ptml> <pead> <meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "> <title> cloud Habitat </title> </pead> <body> <script > var i=0; function addtable (i,id) {var aa; Aa= "<table id=s" +i+ "&GT;&LT;TBODY&GT;&LT;TR width=50><td> serial number <input style=\" Border:none;background: d3e5f3\ "size=4 type=\" text\ name=\ "lsh\" value= "+id+" ></td><td> Delete </td></tr></tbody ></table> "; return AA; } function Delarhui (obj) {Obj.removenode (true); } function Arhui (ID) {if (Checkid (ID)) {sc[sc.length]=id;train.innerhtml+=addtable (i++,id);} //Determine if the incoming ID has been selected var sc=[];//store the selected function Checkid (x) {if (sc.length>0) {var tmp=sc.join (); if (Tmp.indexof (x) >=0) {alert ("collection"); return false; else return True} return true} </script> <form name= "addtable" > <div id= "Train" > Submitted;/div> </form> <table width= "820" border= "1" cellpadding= "1" cellspacing= "1" > <tr bordercolor= " #FFFFFF "bgcolor=" E7e7e7 "> <td> operations </td> <td> serial number </div></td> </tr> <tr& Gt <td> Favorites </td> <td><div align= "center" >1</div></td> </tr> <tr> &L T;td> collection </td> <td><div align= "center" >2</div></td> </tr> <tr> < Td> collection </td> <td><div align= "center" >3</div></td> </tr> <tr> &LT;TD > Favorites </td> <td><div align= "center" >4</div></td> </tr> <tr> &LT;TD&G t; Favorites </td> <td><div align= "center" >5</div></td> </tr> <tr> <td> Favorites </td> <td><div align= "center" >6</div></td> </tr> <tr> <td> Collection </td><td><div align= "center" >7</div></td> </tr> <tr> <td> collection </td> &L T;td><div align= "center" >8</div></td> </tr> <tr> <td> Collection </td> < Td><div align= "center" >9</div></td> </tr> <tr> <td> collection </td> &LT;TD ><div align= "center" >10</div></td> </tr> <tr> <td> collection </td> <td& Gt;<div align= "center" >11</div></td> </tr> <tr> <td> collection </td> &LT;TD&G T;<div align= "center" >12</div></td> </tr> <tr> <td> collection </td> <td&gt ; <div align= "center" >13</div></td> </tr> <tr> <td> collection </td> <td> <div align= "center" >14</div></td> </tr> <tr> <td> collection </td> <td>& Lt;div align= "Center";15</div></td> </tr> <tr> <td> favorites </td> <td><div align= "center" > 16</div></td> </tr> <tr> <td> favorites </td> <td><div align= "center" >1 7</div></td> </tr> <tr> <td> favorites </td> <td><div align= "center" >18 </div></td> </tr> </table> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]

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.