Javascript - Change font color of certain text in textarea

后端 未结 5 2032
忘掉有多难
忘掉有多难 2020-12-31 23:33

Is there any JS function that can change the color of certain text in a textarea?

For example, blar blar {blar} blar, {blar}, including { }, will be in blue. Other w

5条回答
  •  -上瘾入骨i
    2021-01-01 00:22

    you can't use a textarea to do that, per se.

    But, javascript is your friend. Perhaps you should take a look at the code of a few rich text editors.

    You could start with lwrte, since it says its "lightweight". Also, its written in jquery so it will be pretty easy to undertand. (and I'm a jquery fanboy).

    Hope that helps,

    jrh

提交回复
热议问题