title: jQuery each row of a table
body: <p>I have a table with 3 rows and i am trying to loop through the table and get the title attribute for a link in each row of the table, assign it to a variable and put it into a function. Below is the code I am using:</p>
  
  <pre><code>$('tr').each(function(){
          //$('.distance').html("hello"); 
          //nodelat = $(this).find('.latitude').html();
          //nodelon = $(this).find('.longitude').html();
  
          postcode = $(this+".location a").attr('title');
  
          console.log(postcode);
          //$(this).find('.distance').html(distance(startlat, startlon, nodelat,nodelon));
      });
  </code></pre>
  
  <p>For some reason it seems to just repeat the value for the first table row 3 times. Am I missing something?</p>
  
  <p>The code for the table is:</p>
  
  <pre><code>&lt;table id="locations" class="tablesorter"&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;Name&lt;/td&gt;
        &lt;td&gt;Distance&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class="location"&gt;&lt;a href="#Dockyard" onclick="getLatLng(&amp;quot;m502st&amp;quot;, &amp;quot;This is a pub&amp;quot;)" title="m502st"&gt;Dockyard (show on map)&lt;/a&gt;&lt;/td&gt;
        &lt;td class="distance"&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class="location"&gt;&lt;a href="#Joseph Holt" onclick="getLatLng(&amp;quot;M3 1JD&amp;quot;, &amp;quot;http://www.joseph-holt.com&amp;quot;)" title="M3 1JD"&gt;Joseph Holt (show on map)&lt;/a&gt;&lt;/td&gt;
        &lt;td class="distance"&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>