title: How to remove the parent element using plain Javascript
body: <p>How do I remove the parent element and all the respective nodes using plain JavaScript? I'm not using jQuery or any other library.
  In other words, I have an element and when user clicks on it, I want to remove the parent of the parent element (as well as the respective children nodes).</p>
  
  <pre><code>&lt;table id='table'&gt;
      &lt;tr id='id'&gt;
          &lt;td&gt;
              Mohit
          &lt;/td&gt;   
          &lt;td&gt;
              23
          &lt;/td&gt;   
          &lt;td &gt;
          &lt;span onClick="edit(this)"&gt;Edit&lt;/span&gt;/&lt;span onClick="delete_row(this)"&gt;Delete&lt;/span&gt;
          &lt;/td&gt;   
          &lt;td style="display:none;"&gt;
              &lt;span onClick="save(this)"&gt;Save&lt;/span&gt;
          &lt;/td&gt;   
      &lt;/tr&gt;   
  &lt;/table&gt;    
  </code></pre>
  
  <p>Now,</p>
  
  <pre><code>function delete_row(e)
  {
      e.parentNode.parentNode.removeChild(e.parentNode);
  }
  </code></pre>
  
  <p>Will remove only last <code>&lt;td&gt;</code>.</p>
  
  <p>How do I remove the <code>&lt;tr&gt;</code> directly>?</p>
  
  <pre><code>e.parentNode.parentNode.getAttribute('id')
  </code></pre>
  
  <p>returns the id of the row...</p>
  
  <p>Is there any function like <code>remove()</code> or <code>delete()</code> ?</p>