title: How to select td by id
body: <p>I am trying to run the following code but it doesn't seem to select the td by id correctly:</p>
  
  <pre><code>var table = $('&lt;table/&gt;').attr('cellspacing', '2px');
  for (var r = 0; r &lt; length; r++) {
      var trow = $("&lt;tr/&gt;");
      for (var c = 0; c &lt; length; c++) {
          var cellText = $('&lt;div/&gt;').html(texts[r][c]).text();
          $("&lt;td/&gt;").addClass("cell").attr('id', 'td' + r + c).text(cellText).appendTo(trow);
      }
      trow.appendTo(table);
  }
  $('body').append(table);
  alert($("#td00").text());
  </code></pre>
  
  <p>The alert in the end come out empty, although the texts array contains data. What is the correct way to select the td / extract the text? I need it because I wan't to add rowspan of 2 to some of the td's but can't seem to select them properly.</p>