DOM的方法和属性

mac2022-06-30  23

创建节点: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

最新回复(0)