Key node operation

1. Find node:

I: getElementByld () locking one of the node id;

II: getElementByTagName () to find nodes by tag name;

III: document.getElementName (): name value is access node;

IV: children (): Ignore blank and document nodes.

2. Create and add nodes

I: createElement to create nodes;

II: createTextNode create a text node;

III: appendChild node is added to create a subset of the above;

3. Delete Node

I: removeChild: Removes the child node;

4. Replace node

I: replaceChild (new node, old node)

Guess you like

Origin www.cnblogs.com/lee1-w/p/11444018.html