jQuery find previous table row that has a cell with a specific class
<p>Suppose I have a table like so:</p>

<pre><code>&lt;table&gt;
    &lt;tr&gt;&lt;td class="this-is-a-label"&gt;Label Cell&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Detail 1&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td class="selected"&gt;Detail 2&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>I want to be able to grab the previous "Label Cell" from the "Selected" cell.</p>

<p>My jQuery script should be something like:</p>

<pre><code>$('.selected').each(function() {
    var label = $(this).parent().prev('tr td.this-is-a-label');
    //... do what I need with the label ...
});
</code></pre>

<p>But it's not working.</p>

<p>Does anyone have any suggestions?</p>
