/*Try using this function*/
function changeHTMLTag(elemSelector,tagType)
{
var elem = document.querySelector(elemSelector);
elem.outerHTML = '<' + tagType + '>' + elem.innerHTML + '</'+ tagType +'>';
}
// eg usage: change #myElem to use h2 tag -->
changeHTMLTag('#myElem', 'h2');