Color codes in textarea using jquery

Is it possible to color the user entering the code (inside the text box) using jquery.

Specific texts, such as <h1> , <b> , etc., should be colored or highlighted.

this helps to distinguish opening closing tags.

Please, help

+4
source share
2 answers

Not.
Text blocks in <textarea> elements cannot be formatted.

You need to use the ContentEditable element.
Try CodeMirror .

+5
source

jQuery will be able to edit styles of elements that can be styled using CSS. Therefore, it is not possible to edit colors inside the input element.

you can check

Syntaxhighlighter

http://alexgorbatchev.com/wiki/SyntaxHighlighter

+1
source

Source: https://habr.com/ru/post/1313091/


All Articles