replaceChild 替换节点
<div id="app">
<p id="child">hello world</p>
</div>
<!-- 替换节点
parentNode.replaceChild(newNode,targetNode); -->
<script>
var app=document.getElementById("app");
var h1=document.createElement("h1");
h1.innerHTML="change";
var child=document.getElementById("child");
app.replaceChild(h1,child);