DOM的方法和属性

创建节点:createElement();createTextNode()
复制节点:cloneNode()
插入节点:appendChild();insertBefore()
删除节点:removeChild()
替换节点:replaceChild()
设置节点属性:setAttribute()
查找节点:getAttribute();getElementById();getElementsByTagName();hasChildNodes
节点的属性:nodeName;nodeType;nodeValue
遍历节点树:childNodes;firstChild;lastChild;nextSibling;parentNode;previousSibling

原文地址:https://www.cnblogs.com/jvStarBlog/p/3474427.html