How can I modify this javascript so it'll remove both <b> and <i> tags?
===

I'm trying to create the rough equivalent of the "removeFormat" command for Safari. 

Right now I can modify this to remove the bold or italic tags applied to text, but not both at once. 

        
    function RemoveElement (element) {

			  while (element.firstChild) {
				element.parentNode.insertBefore (element.firstChild, element); 
             }
			    element.parentNode.removeChild (element);
    }

    function RemoveBold () {
    var boldTag = document.getElementsByTagName ("b");
    var italicTag = document.getElementsByTagName ("i");

    for (var i = 0; i < boldTag.length; i++) {
                var boldTags = boldTag[i]; 
    }
    
     for (var a = 0; a < italicTag.length; a++) {
                var italicTags = italicTag[a];
    }
			if (boldTag||italicTag)   {
					RemoveElement (italicTags, boldTags);

			}
			}


       