天哪!如何给动态添加的控件命名? i=0;textstr="<input type=text name=text"+(i++)+">"; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 一个控件都可以有id和name,还可以动态改变它的ID <html><script>function add(id){var str="<span><table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"676\"><tr><td><input type=text name=t value=\"值\"></td></tr></table></span>";eval(id).outerHTML=eval(id).outerHTML+str;}</script><head><meta name="GENERATOR" content="Microsoft FrontPage 5.0"><meta name="ProgId" content="FrontPage.Editor.Document"><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>新建网页 1</title></head><body><span><table id=ta1 border="1" width="676" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0"> <tr> <td width="38"> </td> <td width="635"> </td> </tr> <tr> <td width="38"> </td> <td width="635"> </td> </tr> </table> </span> <input type=button name=add value=add onclick="add('ta1')"></body></html> 如何在asp中调用倒是一个问题? <div id=a></div><input type=button onclick="for(i=1;i<21;i++) {a.innerHTML+='<input name=\'b'+i+'\' value=\'b'+i+'\'>';;}"> 急,如何动态添加事件 点击树型目录的内容打开下一级目录如何实现. 弹出窗口的刷新问题 急 一个动态弹出框问题! WIN8.1 IE11 JS做前台校验 返回 FALSE 好像不好用,还是走后台代码! 类似confirm问题请教? 大拿,请解惑,关于tinyMCE,百思不得其解 请帮忙为现有的网页MIDI播放器源代码添加一个功能,以及如何在一个分为多部分的框架中相互传送某些变量? js可以修改xml里的数据吗? "::","->"这两个符号有什么用途,意义 怎么样做到关闭a.htm时刷新b.htm呢? 各位高手请帮忙,急!送100分!
<script>
function add(id)
{
var str="<span><table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"676\"><tr><td><input type=text name=t value=\"值\"></td></tr></table></span>";
eval(id).outerHTML=eval(id).outerHTML+str;}</script>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head><body>
<span>
<table id=ta1 border="1" width="676" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
<tr>
<td width="38"> </td>
<td width="635"> </td>
</tr>
<tr>
<td width="38"> </td>
<td width="635"> </td>
</tr>
</table>
</span>
<input type=button name=add value=add onclick="add('ta1')"></body></html>