title: how to change id tag in table rows
body: <p>Is it possible to change the td.firstChild on each row using jQuery?</p>
  
  <pre><code>&lt;tr&gt;
      &lt;td&gt;
          &lt;input name="wrong" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input name="wrong" /&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;
          &lt;input name="wrong" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input name="wrong" /&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>to this</p>
  
  <pre><code>&lt;tr&gt;
      &lt;td&gt;
          &lt;input name="1" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input name="1" /&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;
          &lt;input name="2" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input name="2" /&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>I have tried with this several ways but it seems that it doesn't do it for each row. It just adds the row count to all of them. I have also managed to increment it for each td.firstChild in the table.</p>
  
  <pre><code>var i = 0;
  var rows = $("tr");
      for (var i = 0; i &lt; rows.length; i++) {
          $("td").each(function () {
              this.firstChild.setAttribute("name", i);
          });
      }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$("tr").each(function (i) {
  
          $("td").each(function () {
                  this.firstChild.setAttribute("name", i);
              });
      });
  </code></pre>
  
  <p>is there a way to solve this?</p>