请问一个JS隐藏层的问题. c.removeChild(c,true); 看逻辑就有问题,c是c的child吗,c.parentNode.removeChild(c)一般提交和不提交可以通过设置name来处理,name为空时,就不会提交,如果删除,要恢复就比较麻烦 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我重写了个...<html><head><script language="javascript">function showyingcang(){var a = document.getElementById("showall");var b = document.getElementById("show");var c = document.getElementById("show_div");var f = document.getElementById("tijiao");var g = document.getElementById("thisform");if (a.checked == true){b.disabled = false;var d = document.createElement("input");d.setAttribute("type","text");d.setAttribute("name","content");c.appendChild(d);g.insertBefore(d,f);}else{b.disabled = true;d.parentNode.removeChild(d,true);}}</script></head><body><form action="showall.php" method="post" id="thisform"><input type="checkbox" id="showall" onclick="showyingcang()"><input type="button" id="show" value="true" disabled><br />用户ID:<input type="text" name="username" id="username"><br />用户PWD:<input type="text" name="password" id="password"><br /><div id="tijiao"><input type="submit" name="tijiao" value="确认提交"> <input type="reset" name="re" value="重置"></div></form></body></html>点击不显示的时候要删除那个层..为什么死都删不掉啊?唉..我是新手..这东西搞的我头都大了... d总是remove不掉..怎么搞的啊? 把不想传的再加上disable="true"就ok了 JS如何模拟鼠标点击X,Y坐标 stopPropagation 有什么语言可以把乘法运算符省略 当修改对象的属性时,能否执行其它语句(有例子)? 想得到转到页 数组能不能post到另一个页面去 请问有没有一种方法,在离开当前页面时自动关闭当前页面的,用js实现 在线急等:如何实现下面功能 http://expert.csdn.net/Expert/topic/1929/1929725.xml?temp=.5074427 支付倒计时问题 求判断是金额的正则表达式,并给个例子 求js写的toolbar工具栏
<html>
<head>
<script language="javascript">
function showyingcang(){
var a = document.getElementById("showall");
var b = document.getElementById("show");
var c = document.getElementById("show_div");
var f = document.getElementById("tijiao");
var g = document.getElementById("thisform");
if (a.checked == true)
{
b.disabled = false;
var d = document.createElement("input");
d.setAttribute("type","text");
d.setAttribute("name","content");
c.appendChild(d);
g.insertBefore(d,f);
}else{
b.disabled = true;
d.parentNode.removeChild(d,true);
}
}
</script>
</head>
<body>
<form action="showall.php" method="post" id="thisform">
<input type="checkbox" id="showall" onclick="showyingcang()">
<input type="button" id="show" value="true" disabled><br />
用户ID:<input type="text" name="username" id="username"><br />
用户PWD:<input type="text" name="password" id="password"><br />
<div id="tijiao">
<input type="submit" name="tijiao" value="确认提交">
<input type="reset" name="re" value="重置">
</div>
</form>
</body>
</html>
点击不显示的时候要删除那个层..为什么死都删不掉啊?
唉..
我是新手..这东西搞的我头都大了...
总是remove不掉..怎么搞的啊?