IE支持让你动态增加元素,但是不支持动态删除元素:)所以你要变通一下了……比如,隐藏起来,修改某个javascript变量做为标志,说明某个Form被隐藏了……等等。具体的操作还是你自己多想想吧,我不知道上面的思路对你有没有帮助。
解决方案 »
- javaSE编程题(请用代码实现)
- 新手请教:如何用byte[]表示一个IP地址
- 文思创新的笔试题?????将包含数字1-49个integer对象填入一个数组列表,然后对列表中的元素随机混排,并且从混排后的列表中选择开头的6个值打印出来
- 如何在jave se中显示web页面,并能让两者相互通信?
- 一个程序例子,请问问题出在哪里???
- 2000 professional为什么不好安装JDK1.4.2啊?
- 一个简单的Java程序编译通过,但是运行不了……
- 下一步该学什么呀????
- 关于一JAVA程序运行另一程序的输出问题,555,多给些分,帮忙啊~~~~
- 求解答,
- 我刚刚拿到了SCJP的证书,在证书里还有一份协议,需要填写后寄给sun公司?请问大家这是作什么样用的?
- 求救,java中读写excel的问题
{
document.all.newAttachmentAnchor.insertAdjacentHTML("AfterBegin","<input type='file' name='attachment' class='text' size='50'/><BR/>");
}
function resetAttachment()
{
//text = "<input type='file' name='attachment' class='text' size='50'/><br>";
//text+= "<span id='newAttachmentAnchor' onclick='insertAttachment()' style='cursor:hand;'>更多附件</span> ";
//text+= "<span id='restoreAttachmentZone' onclick='resetAttachment()' style='cursor:hand;'>重置所有</span>";
attchmentZone.innerHTML = attachmentHtml;
}...
<span id="attchmentZone">
<input type="file" name="attachment" class="text" size="50"/>
<br/>
<span id="newAttachmentAnchor" onclick="insertAttachment()" style="cursor:hand;">
<img src="{$host}/images/ForumBtnAddAttachment.gif" width="16" height="16" alt=""/>更多附件</span>
 
<span id="restoreAttachmentZone" onclick="resetAttachment()" style="cursor:hand;">
<img src="{$host}/images/ForumBtnDelAttachment.gif" width="16" height="16" alt=""/>重置所有</span>
</span>
针对sharetop(天生不笨)兄的设想补充一点,你可以在隐藏的同时,把它的innerHTML设为空,这就间接起到了删除的作用。
function delRows(){
var tb=document.all.tablelist;
var iRowIndex = getRows() ;
if(tb && tb.tagName=="TABLE")
{
tb.deleteRow(iRowIndex) ;
var iRows=tb.rows.length ;
for (var i=iRowIndex;i<iRows;i++){
tb[i]=tb[i+1];
tb.length=tb.length-1;
}
}
}function getRows(){
var src=event.srcElement;
var row=src.parentElement.parentElement;
if(row && row.tagName=="TR")
return row.rowIndex;
}</script>
<BODY BGCOLOR="#FFFFFF">
<table border="1" id="tablelist">
<tr><td><input type=button value=删除 onclick="delRows();"><td><input type=text value="aaaaaa"><td><input type=radio><td><input type=checkbox></tr>
<tr><td><input type=button value=删除 onclick="delRows();"><td><input type=text value="bbbbb" ><td><input type=radio><td><input type=checkbox></tr>
<tr><td><input type=button value=删除 onclick="delRows();"><td><input type=text value="ccccc"><td><input type=radio><td><input type=checkbox></tr>
<tr><td><input type=button value=删除 onclick="delRows();"><td><input type=text value="dddd"><td><input type=radio><td><input type=checkbox></tr>
<tr><td><input type=button value=删除 onclick="delRows();"><td><input type=text value="ddddd"><td><input type=radio><td><input type=checkbox></tr>
</table>
</BODY>try: