admin管理员组文章数量:1289497
Is it possible to color the user entering code (inside a textarea) using jquery.
Specific texts like <h1>
, <b>
etc should be colored or highlighted.
this helps to distinguish the opening closing tags.
Please help
Is it possible to color the user entering code (inside a textarea) using jquery.
Specific texts like <h1>
, <b>
etc should be colored or highlighted.
this helps to distinguish the opening closing tags.
Please help
Share Improve this question asked Jun 17, 2010 at 15:41 Aakash ChakravarthyAakash Chakravarthy 10.7k18 gold badges62 silver badges79 bronze badges2 Answers
Reset to default 8No.
Text blocks in <textarea>
elements cannot be formatted.
You need to use a ContentEditable element.
Try CodeMirror.
jQuery will only be able to edit the styles of elements that can be styled using CSS. It is not possible to edit colours inside an input element in this way.
You might want to check out
SyntaxHighlighter
http://alexgorbatchev./wiki/SyntaxHighlighter
本文标签: javascriptcolor codes in textarea using jqueryStack Overflow
版权声明:本文标题:javascript - color codes in textarea using jquery - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741456275a2379775.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论