Javascript DOM Element Remove Child Paragraph

Description

Javascript DOM Element Remove Child Paragraph

View in separate window


<html>
<head>
    <title>Removing Nodes</title>
</head>//  ww w.j  av a2 s  . co  m
<body>
    <div>
        <p id="myParagraph">This is a test</p>
    </div>

  <script type="text/javascript">
    let paragraph = document.getElementById("myParagraph");
    paragraph.parentNode.removeChild(paragraph);
  </script>
</body>
</html>



PreviousNext

Related