<div id='portlet'>jQuery</div>
<li id='portlet'>jQuery</li>
var node = document.getElementById("portlet"), newNode = document.createElement("li"); while (node.firstChild) { newNode.appendChild(node.firstChild); } node.parentNode.replaceChild(newNode, node); newNode.id = node.id;