How to Add underline to the text which searched through contains()
<pre><code>&lt;div&gt;John Resig&lt;/div&gt;
&lt;div&gt;George Martin&lt;/div&gt;
&lt;div&gt;Malcom John Sinclair&lt;/div&gt;
&lt;div&gt;J. Ohn&lt;/div&gt;
&lt;script&gt;
$("div:contains('John')").css("text-decoration", "underline");
&lt;/script&gt;
</code></pre>

<p>The above code will add underline to the total DIV which contains "John".But how can i make only "John" to be underlined.<br>
Please someone help me.</p>
