title: How to delete all Child Elements from a div element using JS
body: <p>Hey guys i am learning JS, the thing is i made a simple application which display the multiplication table of the input number. The problem is that when i enter a number again the it will print below the previous multiplication table so i want to delete all the child element of div tag when i enter a number again</p>
  
  <pre><code>function print() {
      var box = document.getElementById("table");
  
      for(let i=1 ; i&lt;=10 ; i++) {
          var t = document.getElementById("tabInput").value;
          var t_Element = document.createElement("p");
          var t_line = document.createTextNode(t + " x " + i + " = " + t*i);
          t_Element.appendChild(t_line);
          box.appendChild(t_Element);
      }
  }
  </code></pre>