Remove element by tag name

function removeElementByTagName(tagName)
{
    var element = document.getElementsByTagName(tagName);
    for (index = element.length - 1; index >= 0; index--)
    {
        element[index].parentNode.removeChild(element[index]);
    }
}