jquery if statement detecting if there are tr with "X" class below
<p>I am trying to apply  css rules to tr elements depending on what class would be the following tr.</p>

<p>ex.</p>

<pre><code>&lt;table&gt;
&lt;tr class="x"/&gt;
&lt;tr class="y"/&gt;
&lt;tr class="x"/&gt;
&lt;tr class="x"/&gt;
&lt;/table&gt;
</code></pre>

<p>So those tr with class x that have a following tr with class y will have different css style than those tr that the next tr is with class x.</p>

<pre><code>&lt;script type="text/javascript"&gt;
 $(document).ready(function () {
  if ($("tr.x").next('(tr.y)')) {

        $(this).css({'background-color' : 'yellow', 'font-weight' : 'bolder'});

      }
  else{

       $(this).css({'background-color' : 'blue', 'font-weight' : 'normal'});

      }
});
&lt;/script&gt;
</code></pre>

<p>It is not working at all and I don't know why.</p>

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

<p>Thanks in advance.</p>

<p><strong>Update</strong></p>

<p>I wanted to apply the css style to the first td of the tr, and I am trying;</p>

<pre><code>$(this).first('td').css({ 'color': 'Blue',});
</code></pre>

<p>But still apply it to the row.</p>

<p>Thanks again to all.</p>
