I am getting one string and one array of strings from api, for example as below. (These string and array is dynamic)
samplestring = "You've gotta dance like there's nobody watching, Love like you'll never be hurt, Sing like there's nobody listening, And live like it's heaven on earth.";
samplearray = dance,love,sing (The count is also dynamic)
I want to highlight the strings from samplearray if they are in samplestring,
Something Like
is there anyway to achieve this by css or js?
I saw this question but I can not use this because my string is dynamic. I saw this question also, but I am not sure how to implement.