title: How to dynamically set the id attribute of a HTML element?
body: <p>I have a table and its data are generate by a Java Server page and I want to set the <code>tr</code> id attribute by selecting a row using JavaScript:</p>
  
  <pre><code>&lt;tr&gt;  // this is id attribute i want to set 
     &lt;td&gt;data&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>