是否可以删除除body标签外没有父元素的dom元素?我知道使用像jquery这样的框架会很容易,但我试图坚持直接使用javascript。这是我发现的其他代码:functionremoveElement(parentDiv,childDiv){if(childDiv==parentDiv){alert("Theparentdivcannotberemoved.");}elseif(document.getElementById(childDiv)){varchild=document.getElementById(childDiv);varparent=document.getElem