JS输出问题 恩有个BUTTON按钮然后添加一行 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以动态的插入行列!可参考这种的:<html><head><script type="text/javascript">var isnum;isnum=0;function insRow(){ var istemp; isnum+=1; tr1=document.getElementById('isTable').insertRow(1); //insertRow(),里面的参数0为加在第一行,为空则加在最后一行, tr1.id="atr"+isnum; istemp="atr"+isnum; tr1.insertCell().innerHTML="<font color='#ff0000'>增加行"+isnum+"</font>" ; tr1.insertCell().innerHTML="<input type='text' name='txt'>"; tr1.insertCell().innerHTML="<input type='button' onclick='delRow(\""+istemp+"\")' value='delete'>"; }function delRow(isthis){ isthis=document.getElementById(isthis); myTable=document.getElementById("isTable"); myTable.deleteRow(isthis.rowIndex);}</script></head><body><table id="isTable" border="1"> <tr id="atr1"> <td>Row1 cell1</td> <td>Row1 cell2</td> <td><input type="button" onclick="delRow('atr1')" value="delete"></td> </tr> <tr id="atr2"> <td>Row2 cell1</td> <td>Row2 cell2</td> <td><input type="button" onclick="delRow('atr2')" value="delete"></td> </tr></table><input type="button" onclick="insRow()" value="add"></body></html> zDialog在iFrame中报错 关于canvas画图的问题。。。急!!! EXT如何实现下拉框与文本框的联动? 烦人的打印,一起讨论,来者有分 提示“不能执行已释放Script的代码” 时间轴 文本框中的内容,如何【下载另存为】? 望大家指点. 点击按钮显示图象 关于全文检索!! 为什么这段程序会吧DreamWeaver搞死呢?? 谁能帮小弟看看这几行代码 如何在不打开新窗口的情况下,获取URL的源代码?
可参考这种的:<html>
<head>
<script type="text/javascript">
var isnum;
isnum=0;function insRow()
{
var istemp;
isnum+=1;
tr1=document.getElementById('isTable').insertRow(1); //insertRow(),里面的参数0为加在第一行,为空则加在最后一行,
tr1.id="atr"+isnum;
istemp="atr"+isnum;
tr1.insertCell().innerHTML="<font color='#ff0000'>增加行"+isnum+"</font>" ;
tr1.insertCell().innerHTML="<input type='text' name='txt'>";
tr1.insertCell().innerHTML="<input type='button' onclick='delRow(\""+istemp+"\")' value='delete'>";
}function delRow(isthis)
{
isthis=document.getElementById(isthis);
myTable=document.getElementById("isTable");
myTable.deleteRow(isthis.rowIndex);
}</script>
</head><body><table id="isTable" border="1">
<tr id="atr1">
<td>Row1 cell1</td>
<td>Row1 cell2</td>
<td><input type="button" onclick="delRow('atr1')" value="delete"></td>
</tr>
<tr id="atr2">
<td>Row2 cell1</td>
<td>Row2 cell2</td>
<td><input type="button" onclick="delRow('atr2')" value="delete"></td>
</tr>
</table><input type="button" onclick="insRow()" value="add"></body></html>