title: jquery contains help
body: <p>I have some html which I would like to manipulate. Its structure is as follows:</p>
  
  <pre>
  &lt;tr&gt;
      &lt;td&gt;
          &lt;nobr&gt;TEXT_TO_LOOK_FOR&lt;/nobr&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </pre>
  
  <p>I've written a function here which hides the row containing this text, but I'm just wondering if anyone can clean it up. I feel like it is probably making jquery do more work than it needs to.</p>
  
  <p>I know I could search for a row which contains the text, but I want the function to be robust, so that it does not hide rows if the text is found elsewhere.</p>
  
  <pre><code>function hideRowContainingText(strText)
  {
      var rowMatches = $('tbody tr td nobr:contains(' + '"' + strText + '"' + ')');
      rowMatches.eq(0).parent().parent().parent().css("display", "none");
  }
  </code></pre>
  
  <p>Thanks for any help!</p>