lastChild这个属性 ff不支持

解决方案 »

  1.   

    lastChild FF 是支持的 
    你返回的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);
    }改成这样试试
      

  2.   

    FF 中空白符 也算节点IE 里不把空白符当成节点 你原来的代码在IE中是没问题的
      

  3.   

    http://www.w3schools.com/Dom/prop_document_lastchild.asp
    这里有你要的答案.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); 

    这样应该就可以了
      

  4.   

    http://www.w3schools.com/Dom/prop_document_lastchild.asp 
    这里有你要的答案. 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); 

    打错了一个条件..