开发者

color codes in textarea using jquery

Is it possible to color the user entering code (inside开发者_如何学Go 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


No.
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.com/wiki/SyntaxHighlighter

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜