Currently, I am in the process of working on a JSFiddle and find myself a bit puzzled by a certain aspect. Within my project, I have an input box named myTextField which contains a random paragraph. Additionally, there is a button that triggers my change function. Presently, when the button is clicked, the text displayed in the box is simply shown below it. However, I am seeking to enhance this functionality by changing the color of specific words from an array, let's say to blue. Any guidance on this matter would be greatly appreciated, as I am relatively new to HTML/CSS/JS and may not have all the correct terminology at my disposal.
MyHTML
<input type="text" id="myTextField" value="his first entering a neighbourhood, this truth is so well-fixed in the minds of the surrounding families, that he is considered the rightful property of some one or other of their daughters."/>
<input type="submit" id="byBtn" value="Change" onclick="change()"/>
<p id="title"></p>
Javascript
change = function(){
var matches = ["every", "most", "that", "half", "much", "the", "another", "her", "my", "their", "a", "an", "his", "neither", "these", "all",
"its", "no", "this", "any", "those", "both", "least", "our",
"what", "each", "less", "several", "which", "either", "many", "some",
"whose", "enough", "more", "such", "your"];
//if a value from array matches a value from myTextField
if (matches===document.getElementById('myTextField'))
{
//change color of said words
}
var myNewTitle = document.getElementById('myTextField').value;
var title = document.getElementById('title');
title.innerHTML = myNewTitle;
}