Home /jquery /JQuery Set CSS property of Target /

JQuery Set CSS property of Target

2:17 am, April 23, 2017

Using jquery to search for text of a div target and changing the font weight to bold. Good if you have something you need to change and cant access the code so you have to override with jquery.

$("#adiv li a:contains(some text)").css("font-weight","bold");

<div id='adiv'>
<li>
<a href='#'>a link</a>
</li>
<li>
<a href='#'>another link</a>
</li>
<li>
<a href='#'>some text</a>
</li>
</div>
$("#adiv li a:contains(some text)").css("font-weight","bold");