How can I get the above table on button click?
<p>This is very similar to <a href="http://stackoverflow.com/questions/2081943/jquery-how-to-get-html-table-id-above-button-after-clicked">this question</a>, but it's not working for me. I've also looked at <a href="http://stackoverflow.com/questions/2310270/jquery-find-closest-previous-sibling-with-class">this</a> and <a href="http://stackoverflow.com/questions/2328080/jquery-finding-previous-div">this</a>, but still not working.</p>

<p>I need to get the table ID above the clicked button.<br>
If I click the top button (remove request div) I would get table t1 ID.</p>

<p>My code looks like this:</p>

<pre><code>&lt;table id="t1"&gt;&lt;/table&gt;

&lt;div class="bulk_action"&gt;
  &lt;div title="Remove requests" class="trash_iconset_grey_16px removeRequest"&gt;&lt;/div&gt;
  &lt;div title="some other button" class="abc"&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;table id="t2"&gt;&lt;/table&gt;

&lt;div class="bulk_action"&gt;
  &lt;div title="Remove requests" class="trash_iconset_grey_16px removeRequest"&gt;&lt;/div&gt;
  &lt;div title="some other button" class="abc"&gt;&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>JS code</p>

<pre><code>jQuery('.removeRequest').live ('click', function(){
  var div_obj = jQuery(this).closest('div');
  //alert(jQuery(div_obj).attr('class')); //&lt;-- this works

  var tbl = jQuery(div_obj).prev('table:first'); // &lt;-- This is not working
  alert(jQuery(tbl).attr('id'));
});
</code></pre>

<p>Does anyone have any tips on how to solve this?</p>
