日期:2014-05-17 浏览次数:20688 次
<html> <head> <script language="JavaScript" type="text/javascript"> function get(obj) { var obj = document.getElementById("qx").value; var name = document.getElementById("a") var obj = obj.split('|'); var i=0 for (i=0;i<obj.length;i++){ var shuzi = obj[i]; var iht = ''; iht += '<div><input size=80 value='+shuzi+' />'; iht +='<input type="button" value=" 删除 " class="inputbtn" onclick="deleteNum(this)" /></div><br>'; document.getElementById("a").innerHTML+=iht; } } function deleteNum(obj){ obj.parentNode.parentNode.removeChild(obj.parentNode); } //菜鸟求助 如何才能把整行都删掉 连“删除”按键也删了 //还有为什么遨游不兼容呢??? </script> </head> <body> <div id = "a" ></div> <textarea name="fbaddress" cols="100" rows="5" id="qx">123|456|789</textarea> <input type="button" name="Submit1" value=" 增加 " onclick="get()" class="inputbtn" /> </body> </html>