最近老师留了这么一份作业。要求做一个DOM树节点的导航网页!!!
分不是问题,可以把东西发到我邮箱里。。
[email protected]
谢谢朋友们啦!!!!很急。

解决方案 »

  1.   

    创建节点这块真的很麻烦呀!!!
    function StartList()

      if (document.all&&document.getElementById) 
      { 
        navRoot = document.getElementById("nav"); 
        for (i=0; i<navRoot.childNodes.length; i++) //遍历节点

          node = navRoot.childNodes[i]; 
          if (node.nodeName=="LI") 
      { 
            node.onmouseover=function() 

              this.className+=" over"; 
            } 
            node.onmouseout=function() 

              this.className=this.className.replace(" over", ""); 
            }    
          } 
        } 
      } 
    }
    能帮我解读一下这几行代码么?ClassName是什么意思呀???