Rename a P element:
The renameNode() method renames nodes of type Element and Attr.
Read more about the Element Node object in our Element Node object reference.
Read more about the Attr Node object in our Attr Node object reference.
![]()
The renameNode() method is not supported in any of the major browsers.
| Parameter | Type | Description |
|---|---|---|
| node | Node object | Required. The node object you want to rename |
| namespaceURI | String | Required, but can be set to null if you do not want to specify the namespace URI of the node |
| nodename | String | Required, the new nodename |
| Type | Description |
|---|---|
| Node object | The renamed node |
| DOM Version | Core Level 3 |
|---|
Document Object
Your message has been sent to W3Schools.