you can use document.renameNode , but it not supported most of browser .
how to use document.renameNode ?
document.renameNode(node object, namespaceURI, new nodename);
suppose you want to rename the span html element
var span = document.getElementsByTagName("span")[0];
document.renameNode(span, null, p);
it will rename the node span to p tag
but it not support any browser
in Chrome , you will get error as below :
Uncaught TypeError: document.renameNode is not a function
in firefox ,
TypeError: document.renameNode is not a function