更改特定字符串的颜色

Chr*_*ris 4 javascript string replace colors

有没有人知道如果键入特定文字区域我怎么能改变特定单词的颜色?例如,如果用户键入'hello my friend',它会动态地将'hello'更改为绿色?花了很多时间在谷歌上,找不到任何相关的东西.谢谢.

Dan*_*ite 6

textareas不是为了选择性着色而设计的.