X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM renameNode() Method

Document Object Reference Document Object

Example

Rename a P element:

var p=document.getElementsByTagName("P")[0];
document.renameNode(p,null,"h1");


Definition and Usage

The renameNode() method renames nodes of type Element and Attr.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The renameNode() method is not supported in any of the major browsers.


Syntax

document.renameNode(node,namespaceURI,nodename)

Parameters

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

Return Value

Type Description
Node object The renamed node

Technical Details

DOM Version Core Level 3 Document Object


Document Object Reference Document Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook