Styling letters of a word within an input differently, possible?

前端 未结 4 1329
独厮守ぢ
独厮守ぢ 2021-02-06 04:08

Wondering if this is even possible, but if I have a input containing text, for example lets say the word \'Test\' is in the input. What I would like to be able to do is change

4条回答
  •  半阙折子戏
    2021-02-06 04:28

    You should take a look at how HTML WYSIWYG editors are build.

    Basically, they

    • hide the input field and display another html element with the styled content: Highlight text as you type on textarea

    or

    • use design mode in html: javascript Rich Text Editors

    both ways are not trivial...

提交回复
热议问题