XML DOM renameNode() method

Document object reference manual

Definition and usage

The renameNode() method renames existing element nodes or attribute nodes.

If possible, this method will change the name of the given node, otherwise this method will use the specified name to create a new node, and then use this new node to replace the existing node.

This method returns the renamed node.

Syntax:

renameNode(node,uri,name)
Parameters Description
node The element or attribute that needs to be renamed.
uri String, specifies a new namespace name.
name String, specifies a new name

Document object reference manual