lastChild这个属性 ff不支持
解决方案 »
- 求js匿名对象的应用场合
- 大哥解释一下 prototype框架中$$()是什么意思??
- JS时间控件
- 用正则表达式,实现一个 text 中只能输入 0 到 100 的整数,谢谢了!
- js 操作 listbox
- javascript解析json遇有个题,不知道各位遇到没有?
- 请问如何获得变量或函数的名称
- 很简单的一个问题!在线等待!!
- 高分看看这段代码:<input type='hidden' name=abc value='a'><input type='hidden' name=abc value='b'>为什么提交后只有一个参数能传上
- 谁能解决这个问题,现金300元感谢,绝不食言
- 如何通过代码给ext的grid中的单元格赋值??
- 写一个HTML页面,实现以下功能,左键点击页面时显示“您好”,右键点击时显示“禁止右键”。并在2分钟后自动关闭页面
你返回的elm 是Text对象(空白符等) 不支持 stylefunction addtr(index)
{
var thead=document.getElementById("thead"+index);
elm = thead.lastChild;
if(elm.nodeType==3)
elm = eml.previousSibling;
elm.style.display="";
document.getElementById("tbody"+index).insertBefore(elm);
}改成这样试试
这里有你要的答案.function addtr(index)
{
var thead=document.getElementById("thead"+index);
elm = thead.lastChild;
while(elm.nodeType!=3)
elm = eml.previousSibling;
elm.style.display="";
document.getElementById("tbody"+index).insertBefore(elm);
}
这样应该就可以了
这里有你要的答案. function addtr(index)
{
var thead=document.getElementById("thead"+index);
elm = thead.lastChild;
while(elm.nodeType!=1)
elm = eml.previousSibling;
elm.style.display="";
document.getElementById("tbody"+index).insertBefore(elm);
}
打错了一个条件..