My question is very straight forward. I am trying to put style attribute in a html which is in string format. Through a method i am passing html code in string format. And later i am suppose to add a css in that depending on the situation.
I tried:
"<div style='background-color: red'>'Some data'</div>" // didnt help
"<div style="background-color: red;">'Some data'</div>" // didnt help
In the end:
if(somethingMatches){
data = data.replace('something', "<mark style='background-color: red;'>" + 'something' + "</mark>")
}
Is there some way that i can pull it off...