Javascript examples for DOM:Element removeChild
Remove the element from its parent with removeChild() method
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from ww w . j a va2 s . c o m var parent = document.getElementById('parent'); parent.removeChild(parent.firstChild); } </script> </head> <body> <div id="parent"> I'm gone with the wind <div id="child"> I stay here </div> </div> </body> </html>