so all the tutorials on replacing words for Google Chrome gives me something like this -
var replacedText = text.replace(/(hello)/gi, "goodbye");
if (replacedText !== text) {
element.style.color = colour;
element.replaceChild(document.createTextNode(replacedText), node);
}
So I understand that the data I receive is a sentence and I can specifically replace words and update the sentence. What I want to achieve is to turn singular words to a different colour. Right now it will change the entire sentence to red.
Does anyone know how to do this?