编辑下面的代码:【加编码】
<html> <body> <div id="div1"> <p id="p1">This is a paragraph.</p> <p id="p2">This is another paragraph.</p> </div> <script> var parent=document.getElementById("div1"); var child=document.getElementById("p1"); parent.removeChild(child); </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂