title: How to set name and id on a TR element?
body: <p>I need to access <code>TR</code> elements through <code>firstChild</code> or <code>lastChild</code> object, however using <code>ID</code> or <code>Name</code> property doesn't seem to be working:</p>
  
  <p><a href="https://jsfiddle.net/7594v0kg/13/" rel="nofollow noreferrer">https://jsfiddle.net/7594v0kg/13/</a></p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;table id="tbl"&gt;
  &lt;tr name="first" id="first"&gt;
      &lt;td&gt;123&lt;/td&gt;
      &lt;td&gt;456&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr name="second"&gt;
      &lt;td&gt;789&lt;/td&gt;
      &lt;td&gt;987&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;span id="out"&gt;&lt;/span&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Javascript code:</p>
  
  <pre><code>var elt=document.getElementById("tbl")
  var out=document.getElementById("out")
  out.innerHTML="name="+ +elt.firstChild.name+",id="+elt.firstChild.id
  </code></pre>
  
  <p>the output is:</p>
  
  <pre><code>123 456
  789 987
  name=NaN,id=undefined
  </code></pre>
  
  <p>How should I modify my code to access the elements by <code>id</code> or <code>name</code>? This is needed to implement a deleting process but only children labeled with some values should remain. </p>
  
  <p>JSFildle is provided
  <a href="https://jsfiddle.net/7594v0kg/13/" rel="nofollow noreferrer">https://jsfiddle.net/7594v0kg/13/</a></p>