title: Change the color of a text in div using jquery contains
body: <p>Here the whole text inside the div get's red color. but I need only the "bar" word color to be changed   </p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
      &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
       &lt;head&gt;
        &lt;title&gt; new document &lt;/title&gt;
       &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;
       &lt;script type="text/javascript"&gt;
          $(document).ready(function(){
              $("#foo:contains('bar')").css('color','red');
          });
       &lt;/script&gt;
       &lt;/head&gt;
       &lt;body&gt;
      &lt;div id="foo"&gt;
          this is a new bar 
      &lt;/div&gt;
       &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>