title: Select specific closest element
body: <p>I have the following html :</p>
  
  <pre><code>  &lt;table id="objects"&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;input type="text" value="2" /&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;a href="#" class="delete"&gt;link&lt;/a&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;input type="text" value="4" /&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;a href="#" class="delete"&gt;link&lt;/a&gt;
          &lt;/td&gt;
      &lt;/tr&gt;    
    &lt;/table&gt;
  </code></pre>
  
  <p>When I click anchor tag I'd like to select <code>&lt;input&gt;</code> closest to my link, and get it's value. How can I do this ? I was trying :</p>
  
  <pre><code>  $('.delete').click(function(e){
      e.preventDefault();
      var val = $(this).closest('input').attr('value');
      alert(val);
    });
  </code></pre>
  
  <p>but without any luck. </p>