节点操作重点

1.查找节点:

I:getElementByld()锁定id的某一个节点;

II:getElementByTagName()通过标签名称来查找节点;

III:document.getElementName():访问的是节点中的name值;

IV:children():忽略空白及文档节点。

2.创建及添加节点

I:createElement创建节点;

II:createTextNode创建文本节点;

III:appendChild将创建的节点添加到子集上面;

3.删除节点

I:removeChild:删除子节点;

4.替换节点

I:replaceChild(新节点,旧节点)

猜你喜欢

转载自www.cnblogs.com/lee1-w/p/11444018.html