Working "Add Paragraph" Function

<input type="button" value="Add Paragraph" onclick="np()" />
  <script>
    function np(){
      const para = document.createElement("p");
      const node = document.createTextNode("This is new.");
      para.appendChild(node);
      const element = document.getElementById("div1");
      element.appendChild(para);
    }
</script>