<head><script language="javascript">
function add()
{
    //动态创建 TR 元素  
    var temptr = document.createElement("tr");
    //指定一个ID值
    temptr.id="t2"
    //对刚才创建的t2元素进行追加代码
var tempTd1 = document.createElement("td");
tempTd1.innerHTML = "<input name='txt1'>";
    temptr.appendChild(tempTd1);
var tempTd2 = document.createElement("td");
tempTd2.innerHTML = "<input name='txt2'>";
    temptr.appendChild(tempTd2);
    //对tb1表格进行追加一个TR元素
    tb1.children[0].appendChild(temptr);
}
</script>
</head>
<form  action="a.asp" method="post" >
<table id="tb1">
<tr id="t1">
    <td> <input name="a1"></td> 
    <td> <input name="b1"></td> 
</tr>
</table>
</form><!-- 调用 add 函数    -->
<input type=button onclick="add()" >