title: substring selector with jquery?
body: <p>Is it possible to select only part of a string using jquery? For example I have a text</p>
  
  <pre><code>&lt;p&gt;Metuentes igitur idem latrones Lycaoniam magna parte campestrem&lt;/p&gt;
  </code></pre>
  
  <p>So now if the user search for a string, I want it to be highlighted (we use a bold tag for example)</p>
  
  <pre><code>&lt;p&gt;Metuentes igitur idem latrones &lt;b&gt;Lycaoniam&lt;/b&gt; magna parte campestrem&lt;/p&gt;
  </code></pre>
  
  <p>And then we can revert back to original string if needed.</p>
  
  <ol>
  <li>The first question is whether we can select a substring like this using jQuery, and use jQuery method such as <code>.css()</code> to apply style to that element.</li>
  <li>The second question is if we don't have such selector, how can we achieve it using jQuery or javascript through string manipulation</li>
  </ol>
  
  <p>Thanks.</p>
  
  <p><strong>UPDATED</strong></p>
  
  <p>Thank for everyone effort. Here is a small program, final result of what I'm looking for <a href="http://jsfiddle.net/TPg9p/3/" rel="nofollow">http://jsfiddle.net/TPg9p/3/</a> Cheers!</p>