<div id="test">
<p>我是将要被删除的节点</p>
</div>
实例JavaScript代码
<script type="text/javascript">
function remove(){
var test = document.getElementById("test");
var children = test.childNodes;
for(i=0;i<children.length;i++){
test.removeChild(children[i]);
}
}
</script>