We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.访问/获取节点
getElementById(id); //返回对拥有指定id的第一个对象进行访问 getElementsByName(name); //返回带有指定名称的节点集合 getElementsByTagName(tagname); //返回带有指定标签名的对象集合 getElementsByClassName(classname); //返回带有指定class名称的对象集合
2.创建节点/属性
document.createElement(eName); //创建一个节点 document.createAttribute(attrName); //对某个节点创建属性 document.createTextNode(text); //创建文本节点
3.添加节点
document.insertBefore(newNode,referenceNode); //在某个节点前插入节点 parentNode.appendChild(newNode); //给某个节点添加子节点
4.复制节点
cloneNode(true | false); //复制某个节点 参数:是否复制原节点的所有属性
5.删除节点
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1.访问/获取节点
2.创建节点/属性
3.添加节点
4.复制节点
5.删除节点
The text was updated successfully, but these errors were encountered: