/***
Changes an HTML elements HTML tag from one type to another
@ Params:
elemSelector - the css selector of the element you want to change
tagType - the type of tag to change the element to
***/
function changeHTMLTag(elemSelector,tagType)
{
jQuery(elemSelector).replaceWith(
function()
{
return jQuery("<"+ tagType +">", {class: this.className, html: jQuery(this).html()});
}
);
}
// example usage:
changeHTMLTag('#myElement','h2'); // This will change the element into a h2 tag