title: How to get last element in the .find() object by jquery
body: <p>I have DOM like this:</p>
  
  <pre><code>&lt;div class="parent"&gt;
     &lt;button class="add-tr"&gt;Add&lt;/button&gt;
     &lt;table class="child"&gt;
     &lt;tr data="0"&gt;&lt;/tr&gt;
     &lt;tr data="1"&gt;&lt;/tr&gt;
     ...
     &lt;/table&gt;
  &lt;/div&gt;
  &lt;div class="parent"&gt;
     &lt;button class="add-tr"&gt;Add&lt;/button&gt;
     &lt;table class="child"&gt;
     &lt;tr data="0"&gt;&lt;/tr&gt;
     &lt;tr data="1"&gt;&lt;/tr&gt;
     ...
     &lt;/table&gt;
  &lt;/div&gt;
  ...
  </code></pre>
  
  <p>When I click on the Add button, I would like to get the value of the data attribute from the last  of it own parent class. </p>
  
  <p>I am using this method to get the last element,but it doesn't work. </p>
  
  <pre><code>$('.add-tr').click( function() {
     var last = $(this).parent().find('.child:last').attr('data');
     alert(last);
  })
  </code></pre>
  
  <p>Any idea why? Or any other suggestion to get the last element in the table?</p>
  
  <p><strong>UPDATE</strong>
  Yes, I found the problem, turn out is I forgot the 'tr'. Thanks for your guys answer. All your guys giving the correct answer, I wish I can accept all your answers. Thanks  </p>