Preview HTML markup inside textarea

僤鯓⒐⒋嵵緔 提交于 2019-12-23 04:34:05

问题


How to transform html codes within textarea while typing, as text editors do? I searched a lot, but preview is outside the textarea (which is very simple by jquery). I want to know the trick text editors do to display formatted html inside the textarea!

Note that I do not want a text editor, I want to show markeup when typping; for example displaying BOLD when typing <b>BOLD</b> inside textarea.


回答1:


textarea does not have such a feature. However, you can still achieve the same effect with some Javascript acrobatics.

Check this out: http://www.kevinroth.com/rte/demo.htm



来源:https://stackoverflow.com/questions/9232498/preview-html-markup-inside-textarea

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!