title: javascript parentnode.id not working the way i expected
body: <p>Right now I have this code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
     function delete_box(n) {
       document.getElementById("box"+n).style.display = "none";
     }
  &lt;script&gt;
  
  &lt;div id="box1"&gt;
   &lt;table&gt;
    &lt;td&gt;some code&lt;/td&gt;&lt;td&gt;&lt;input type="button" value="Delete this box" onclick="delete_box(1)"&gt;&lt;/td&gt;
   &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>It works fine. When I press the button the box disappears. However I want to simplify and have it like this:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
     function delete_box(n) {
       document.getElementById(n).style.display = "none";
     }
  &lt;script&gt;
  
  &lt;div id="box1"&gt;
   &lt;table&gt;
    &lt;td&gt;some code&lt;/td&gt;&lt;td&gt;&lt;input type="button" value="Delete this box" onclick="delete_box(this.parentnode.id)"&gt;&lt;/td&gt;
   &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>However it wont work as intended. The console says that the id is null and I'm not sure why. What have I done wrong?</p>
  
  <p>Thank you.</p>