Skip to content

jQuery: Search String Inside DIV tag

let want to modify/add style inside DIV tag contains “Jhon” string

below example the code

<div>John Resig</div>
<div>George Martin</div>
<div>Malcom John Sinclair</div>
<div>J. Ohn</div>
$( "div:contains('John')" ).css( "text-decoration", "underline" );


John Resig
George Martin
Malcom John Sinclair
J. Ohn


Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *