JS/jQuery : Best way to format/emphasise specific words in a textarea
I want to be able to detect text that h开发者_运维知识库as been entered and display this back to the user by changing the color of specific words in a textarea. Much the same way as in Facebook or Twitter when a user enters a @username tag into a posting.
I want that word to be highlighted to the user before the post is submitted so that they are aware the application has acknowledged it.
What is the best way to achieve this kind of styling?
Textarea elements do not allow styling:
<textarea><b>Hi</b></textarea>
Will not bold the text, it will display the html as text. Instead, try the contenteditable attribute.
精彩评论