Easy Tutorial
❮ Met Element Getattributenodens Dom Namednodemap ❯

XML DOM renameNode() Method



Definition and Usage

The renameNode() method renames an existing element or attribute node.

If possible, this method changes the name of the given node; otherwise, it creates a new node with the specified name and replaces the existing node with this new node.

The method returns the renamed node.

Syntax

Parameter Description
node The element or attribute that needs to be renamed.
uri A string specifying the new namespace URI.
name A string specifying the new name.
❮ Met Element Getattributenodens Dom Namednodemap ❯