Replace Text in Div using contains(match)
<p><strong>jsFiddle:</strong> <a href="http://jsfiddle.net/WM6wG/" rel="nofollow">http://jsfiddle.net/WM6wG/</a></p>

<p>I'm trying to replace a text in a div, but cannot seem to figure out why it's not working.</p>

<p><em>HTML:</em></p>

<pre><code>&lt;div class="text"&gt;abc&lt;/div&gt;
&lt;div class="text"&gt;foo&lt;/div&gt;
&lt;div class="text"&gt;bar&lt;/div&gt;
</code></pre>

<p><em>jQuery:</em></p>

<pre><code>var match = 'abc';
if ($('div.text:contains(match)')) {
    $('div.text').html(function(){
        $(this).replaceText(match, 'xyz');
    }
}
</code></pre>

<p>Ideally the expected output should be: <code>xyz foo bar</code> but it remains <code>abc foo bar</code>, what am I doing wrong?</p>
