Change font color
Change font color
I have a function which takes the word that I type in a text box, compares it to an array and if the word matches an element in the array, it wraps it in a `span` tag and tries to change the color of that word. However, I can not get the font color to actually change.. Can somebody please help me?
- function wrapLinesForKeyword($container, word) {
-
- var word = word.trim();
- var tmp = '';
-
- for (var i = 0; i < reservedKeyWords.length; i++) {
-
- if (word == reservedKeyWords[i]) {
-
- var tmp = '<span>' + word + '</span> ';
- $(word).css('color', 'blue');
- console.log(tmp);
- }
- }
- }