ITeye博客

JavaScript DOM编程艺术(第二版)笔记

xiaotongeye · 2018-05-22 17:38 · JavaScript · Web前端 · Markdown

1.CSS继承机制; 2.getElementById,getElementsByTagName,getElementsByClassName,getAttribute,setAttribute; 3.element.childNodes element.parentNode nextSibling previousSibling childNodes firstChild lastChild node.firstChild node.childNodes node.lastChild node.childNodes 4.node.nodeType 元素结点的nodeType属性值是1 属性节点的nodeType属性值是2 文本节点的nodeType属性值是3 5.node.nodeValue 渐进增强 平稳退化 6.


   function addLoadEvent(func){
        var oldonload = window.onload;
        if(typeof window.onload != 'function'){
             window.onload = func;
        }else{
             window.onload = function(){
                  oldonload();
                  func();
             }
        }
  }


document.write()
node.innerHTML="<p>I inserten</p>"
createElement
appendChild
createTextNode
parentElement.insertBefore(newElement,targetElement)

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。