let say..you 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>
<script>
$( "div:contains('John')" ).css( "text-decoration", "underline" );
</script>
Results:
John Resig
George Martin
Malcom John Sinclair
J. Ohn
Be First to Comment