title: jquery highlight row based on column value
body: <p>Hi I am hoping that somebody can help me to tweak this JQuery code so that it will highlight the entire data row rather than just the cell containing the value 'N'. I have tried to apply the code to the table row but it is still only highlighting the background color of the cell containing the value of 'N' where as I need to highlight the entire table row. Does anybody have any suggestions?</p>
  
  <pre><code>    &lt;html&gt;
      &lt;head&gt; 
      &lt;script type="text/javascript" 
      src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"&gt;&lt;/script&gt; 
      &lt;script type="text/javascript"&gt;  
  
      $(document).ready(function(){
                         $('#table_id tr.y_n td').each(function(){
                                                             if ($(this).text() == 'N') {
                                                                 $(this).css('background-color','#f00');
                                                                 }
                                                                 }); 
                         });
  
      &lt;/script&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
      &lt;table id="table_id"&gt;
        &lt;tr&gt;&lt;th&gt;Question&lt;/th&gt;&lt;th&gt;Y/N?&lt;/th&gt;&lt;/tr&gt;  
        &lt;tr&gt;&lt;td&gt;I am me.&lt;/td&gt;&lt;td&gt;Y&lt;/td&gt;&lt;/tr&gt;  
        &lt;tr class="y_n"&gt;&lt;td&gt;N&lt;/td&gt;&lt;td&gt;Y&lt;/td&gt;&lt;/tr&gt;  
        &lt;tr&gt;&lt;td&gt;I am not sure.&lt;/td&gt;&lt;td class="y_n"&gt;Y&lt;/td&gt;&lt;/tr&gt;  
        &lt;tr&gt;&lt;td&gt;This is a table.&lt;/td&gt;&lt;td class="y_n"&gt;Y&lt;/td&gt;&lt;/tr&gt;
       &lt;/table&gt;  
  
       &lt;/body&gt; 
       &lt;/html&gt; 
  </code></pre>