var aArray = document.body.getElementsByTagName('a'); while (aArray.length) { aArray[0].parentNode.removeChild(aArray[0]); }