| 动态添加表格行: <table border=1> <tr id=a1> <td><input></td><td><input></td> </tr> </table> <input type=button name=ok onclick=add() value="增加"> <script language=JavaScript> i=1 function add(){ var newTR = a1.cloneNode(true); newTR.id="a"+(++i) a1.parentNode.insertAdjacentElement("beforeEnd",newTR); } </script> |
原载: No.1网络工作室 http://www.noonenet.cn/