title: Get the contents of a table row with a button click
body: <p>I need to extract the details of each column in my table. For example, column "Name/Nr.".</p>
  
  <ul>
  <li>The table contains a number of addresses</li>
  <li>The very last column of each row has a button that lets a user choose a listed address.</li>
  </ul>
  
  <p><strong>Problem:</strong> My code only picks up the first <code>&lt;td&gt;</code> that has a class <code>nr</code>. How do I get this to work?</p>
  
  <p><strong>Here's the jQuery bit:</strong></p>
  
  <pre><code>$(".use-address").click(function() {
      var id = $("#choose-address-table").find(".nr:first").text();
      $("#resultas").append(id); // Testing: append the contents of the td to a div
  });
  </code></pre>
  
  <p><strong>Table:</strong></p>
  
  <pre><code>&lt;table id="choose-address-table" class="ui-widget ui-widget-content"&gt;
      &lt;thead&gt;
          &lt;tr class="ui-widget-header "&gt;
              &lt;th&gt;Name/Nr.&lt;/th&gt;
              &lt;th&gt;Street&lt;/th&gt;
              &lt;th&gt;Town&lt;/th&gt;
              &lt;th&gt;Postcode&lt;/th&gt;
              &lt;th&gt;Country&lt;/th&gt;
              &lt;th&gt;Options&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td class="nr"&gt;&lt;span&gt;50&lt;/span&gt;
              &lt;/td&gt;
              &lt;td&gt;Some Street 1&lt;/td&gt;
              &lt;td&gt;Leeds&lt;/td&gt;
              &lt;td&gt;L0 0XX&lt;/td&gt;
              &lt;td&gt;United Kingdom&lt;/td&gt;
              &lt;td&gt;
                  &lt;button type="button" class="use-address" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td class="nr"&gt;49&lt;/td&gt;
              &lt;td&gt;Some Street 2&lt;/td&gt;
              &lt;td&gt;Lancaster&lt;/td&gt;
              &lt;td&gt;L0 0XX&lt;/td&gt;
              &lt;td&gt;United Kingdom&lt;/td&gt;
              &lt;td&gt;
                  &lt;button type="button" class="use-address" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>