Download this case: nodeop.html (2.38 KB)
ReplaceChildOfUsage
Summary
Node replaceChild (Node newChild, Node oldChild)
Parameters
NewChild new replacement Node
OldChild node to be replaced
Return Value
Replaced old Node
-----------------------
CloneNode usage
Copy nodes and all child nodes
Summary
Node cloneNode (bool deep)
Parameters
If deep is true, the current node and all child nodes are copied.
Return Value
Current node copy
-----------------------------
AppendChildUsage
Insert a node as the last node of the current node
Summary
Node appendChild (Node newChild)
Parameters
NewChild node to be inserted
Return Value
Node TO BE INSERTED
-----------------------------
InsertBeforeUsage
Insert a node before a specified Node
Summary
Node insertBefore (Node newChild, Node refChild)
Parameters
NewChild node to be inserted
The refChild is located before the node to be inserted. If it is null, newChild is inserted to the last subnode of the current node.
Return Value
Node TO BE INSERTED
-----------------------------
Passed the test in ie 6 7 8 and ff
From: http://www.eyejs.com /? Action-viewnews-itemid-17