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?

  1. function wrapLinesForKeyword($container, word) {
  2.            
  3.             var word = word.trim();
  4.             var tmp = '';
  5.             
  6.             for (var i = 0; i < reservedKeyWords.length; i++) {
  7.                 
  8.                 if (word == reservedKeyWords[i]) {

  9.                     var tmp = '<span>' + word + '</span> ';
  10.                     $(word).css('color', 'blue');                  
  11.                     console.log(tmp);
  12.                 }
  13.             }
  14. }