JavaScript DOM编程艺术(第二版)笔记
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)