So I\'m working on a JSFiddle and I\'m a little confused about something. I have an input box called myTextField with a random paragraph and a button that calls my change functi
This is just a guess, but why don't you try this
This is assuming, you want to change the words, on the blur
var input = document.getElementById("my-input");
var par = document.getElementById("par");
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"];
input.addEventListener("blur", function() {
var inputValue = input.value;
par.innerHTML = "";
inputValue.split(' ').forEach(function(word) {
if (matches.indexOf(word) > -1) {
par.innerHTML += "" + word + " " + "";
}
else {
par.innerHTML += word + " ";
}
});
});
.colored {
color: blue;
}