HTML DOM renameNode() method
Example
Rename the p element:
var p=document.getElementsByTagName("P")[0];
document.renameNode(p,null,"h1");
Definition and Usage
The renameNode() method renames an existing element node or attribute node.
Browser support





Currently no major browser supports the renameNode() method.
Syntax
document.renameNode(
node
,
namespaceURI
,
nodename
)
Parameters
| Parameters | Type | Description |
|---|---|---|
| node | Node object | Required. The node object that needs to be renamed. |
| namespaceURI | String | Required. If you do not want to specify a namespace URI, the node can be set to null . |
| nodename | String | Required. The new node name. |
Return Value
| Type | Description |
|---|---|
| Node object | Rename the node |
Technical Details
| DOM version | Core Level 3 Document object |
|---|
Document Object