title: Simple Text Highlight with jQuery
body: <p>First of all, YES, I know there are many highlight jquery plugins out there, I've seen them and they made me satisfied, but now there is a question for me which I want to ask!</p>
  
  <p>Why should I use a plugin which is 7kb? this should be solved with 2 lines of code...</p>
  
  <p>Here is what I am doing, I'm searching in my webapp and I want to highlight matching parts, for example I enter "<code>ab</code>" as search query, then I will have these results loaded by Ajax into my HTML:</p>
  
  <pre><code>&lt;div class="blah"&gt;&lt;h3&gt;&lt;a&gt;Abicert&lt;/a&gt;&lt;/h3&gt;&lt;/div&gt;
  &lt;div class="blah"&gt;&lt;h3&gt;&lt;a&gt;The aboony test&lt;/a&gt;&lt;/h3&gt;&lt;/div&gt;
  &lt;div class="blah"&gt;&lt;h3&gt;&lt;a&gt;Abnormal abiba!!!&lt;/a&gt;&lt;/h3&gt;&lt;/div&gt;
  </code></pre>
  
  <p>So in the above results, every "<code>ab</code>" should be highlighted, like:</p>
  
  <p><strong>Ab</strong> icert</p>
  
  <p><strong>ab</strong> oony test</p>
  
  <p><strong>Ab</strong> normal <strong>ab</strong> iba!!!</p>
  
  <p>So, my jQuery is:</p>
  
  <pre><code>$('.blah h3 a').each(function(){
      var text = $(this).text();
      var searched_text = 'ab';
      // MY QUESTION HERE - How to highlight part of this text
  });
  </code></pre>
  
  <p><strong>Another thing that I need to mention is that:</strong> the User may enter "<code>ab anotherquery</code>" as his search query, so this should be exploded by space, and in the results every "<code>ab</code>" and "<code>anotherquery</code>" should be highlighted.</p>
  
  <p>I would like to learn this, it's not a thing that I could not solve with ready plugins...</p>
  
  <p>Thanks in advance</p>