OldNode. ReplaceNode (newNode) method in IE can realize node replacement, but they were not in fierfox;
later, very not easy to solve this problem:

function (oldNode, newNode)
{
oldNode. ParentNode. The appendChild (newNode)
oldNode. ParentNode. RemoveChild (oldNode);

}

you might be interested in the article:

  • jQuery: nodes (insert, copy, replace, and delete) operations
  • javaScript (JS) to replace the node implementation approach introduced


This concludes the body part