The designer wants to make the company name blue, but the company name is inserted into the text without any html element surrounding it.
I want to find the line and set only this line to blue
I have this code, but it makes all the text blue
$(function() { $('div:contains("The Company Name")').css("color","blue"); });
this is sample code
<div>The company name is great and makes a lot of happy customers</div> <div>You can have more info on <a href="link">The company name</a>[...]</div>
As a result i want
<div><span style="color:blue;">The company name</span> is great and makes a lot of happy customers</div> <div>You can have more info on <a href="link"><span style="color:blue;">The company name</span></a>[...]</div>
Is anyone
source share