动态删除Html元素(请教高手) document.getElementById("sadsd").removeNode(true) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 document.getElementById("sadsd").removeNode(true)如果是多加几个就不可以了,我的只可以删除一个, <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" ><HTML> <HEAD> <title>WebForm2</title> <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"> <meta name="CODE_LANGUAGE" Content="C#"> <meta name="vs_defaultClientScript" content="JavaScript"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> <script language="javascript"> var i=0; function ContinueUpLoad() { var str = '<div id=div'+i+'><INPUT id=file'+i+' type=file size=50 NAME=File><input id =btn'+i+' type =button value=删除 onclick =delFile("div'+i+'")></div>' document.getElementById('MyFile').insertAdjacentHTML("beforeEnd",str); } function delFile(diva) { document.getElementById(diva).parentNode.removeChild(document.getElementById(diva)) } </script> </HEAD> <body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server" enctype="multipart/form-data"> <div> <table> <tr> <td id="tdRrmove" width="80"> <div id="MyFile"><FONT face="宋体"></FONT> </div> </td> </tr> </table> </div> <INPUT type="button" value="添加附件" onclick="ContinueUpLoad()"> <asp:Button id="UploadButton" runat="server" Text="Button"></asp:Button> <asp:Label id="strStatus" runat="server">Label</asp:Label> </form> </body></HTML> javascript关于监听浏览器关闭问题 急找大神求一数字类型JS正则验证 写一个带复选框的下拉列表~~~~~~~~~~~~~· 散分了,顺便 问个小问题 哪个有js分割条代码,共享一下谢谢 js控制图层的显隐(不是鼠标控制) 关于ajax的调用如何接收返回字符串 一个关于FLASH在web里的问题+ = = = = = 高难度问题100分,如何在客户端使用javascript脚本.... 求中文和字母混合(中国FC 或者 中F国CDE)的正则表达式 js随机函数问题,请高手赐教!! 救急!!!网页事件!!!
如果是多加几个就不可以了,我的只可以删除一个,
<HTML>
<HEAD>
<title>WebForm2</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<script language="javascript">
var i=0;
function ContinueUpLoad()
{
var str = '<div id=div'+i+'><INPUT id=file'+i+' type=file size=50 NAME=File><input id =btn'+i+' type =button value=删除 onclick =delFile("div'+i+'")></div>'
document.getElementById('MyFile').insertAdjacentHTML("beforeEnd",str);
}
function delFile(diva)
{
document.getElementById(diva).parentNode.removeChild(document.getElementById(diva))
} </script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server" enctype="multipart/form-data">
<div>
<table>
<tr>
<td id="tdRrmove" width="80">
<div id="MyFile"><FONT face="宋体"></FONT>
</div>
</td>
</tr>
</table>
</div>
<INPUT type="button" value="添加附件" onclick="ContinueUpLoad()">
<asp:Button id="UploadButton" runat="server" Text="Button"></asp:Button>
<asp:Label id="strStatus" runat="server">Label</asp:Label>
</form>
</body>
</HTML>