DOM主要方法
查找节点
element = document.getElementById(id)
elements = document.getElementsByTagName(tagName)
attributeValue = element.getAttribute(attributeName)
booleanValue = element.hasChildNodes()
创建节点
reference = document.createElement(element)
reference = document.createTextNode(text)
复制节点
reference = node.cloneNode(booleanValue)
插入节点
element.appendChild(newChild)
element.insertBefore(newNode, targetNode)
替换节点
element.replaceChild(newChild, oldChild)
设置节点属性
element.setAttribute(attributeName, attributeValue)
删除节点
element.removeChild(node)
DOM属性
节点属性
nodeName
nodeType
nodeValue
遍历节点树
childNodes
firstChild
lastChild
nextSibling
previousSibling
parentNode