How do I get to cousin elements with JQuery?
<p>I have a table with many rows of data, and I want to show or hide some of the details on each row based on a checkbox in the first element.  For example:</p>

<pre><code>&lt;table&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;span class="aspnetweirdness"&gt;&lt;input type=checkbox&gt;&lt;/span&gt;&lt;/td&gt;
    &lt;td&gt;Text Text Text&lt;/td&gt;
    &lt;td&gt;&lt;select /&gt;&lt;/td&gt;
    &lt;td&gt;&lt;input type=text&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>I'm looking to traverse from the checkbox to the cousin elements (the text, the select, and the text input) with jquery and toggle the visibility on those elements based on whether the checkbox is checked.  One small snag is that the checkbox is wrapped in a span, since this is being output by asp.net.  That also makes the elements harder to get at by id.</p>

<p>How would I go about doing this?  I've tried $(this).parentsUntil('tr').siblings(), but it doesn't seem like i get the right elements.</p>

<p>Any help would be appreciated.</p>

<p>EDIT:</p>

<pre><code> $(".crewMemberTable input:checkbox").toggle(function() {
            $(this).closest('tr').find('select, input:not(:checkbox)').fadeIn();
            $(this).closest('tr').find('label').css('font-weight', 'bold');
        }, function() {
            $(this).closest('tr').find('select, input:not(:checkbox)').fadeOut();
            $(this).closest('tr').find('label').css('font-weight', 'normal');
        });
</code></pre>
