X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML 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

Method
renameNode() Not supported Not supported Not supported Not supported Not supported


Syntax

document.renameNode(node,namespaceURI,nodename)

Parameter Values

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

Technical Details

Return Value: A Node object, representing the renamed node
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 HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook