Let's
assume word has the value "function". It is
a string, correct?
$(word).css('color', 'blue');
will apply the CSS to
every
<function> element in your
document. I doubt that's what you want to do.
You want
this:
var tmp =
'<span style="color:blue;" >' + word +
'</span> ';
Or,
better still:
var tmp = '<span class="reserved_word">' +
word + '</span> ';
And apply the color in a
style sheet.