title: jQuery if "this" contains
body: <p>I'm trying to change any elements containing a particular text string to a red color. In my example I can get the child elements to become blue, but there's something about the way I've written the 'Replace Me' line that is incorrect; the red color change doesn't happen. I note that the "contains" method is usually written as <code>:contains</code> but I couldn't get that to validate with <code>$(this)</code>.</p>
  
  <pre><code>$('#main-content-panel .entry').each(function() {
         $(this).css('color', 'blue');      
  });         
  
  $('#main-content-panel .entry').each(function() {
     if($(this).contains("Replace Me").length &gt; 0) {
          $(this).css('color', 'red'); 
      }      
  });
  </code></pre>
  
  <p>Fiddle: <a href="http://jsfiddle.net/zatHH/" rel="noreferrer">http://jsfiddle.net/zatHH/</a></p>