Thanks for your reply - let me explain in a less verbose way.
I have a TextArea in which the user types Regex.
I then have a script which gets that text, highlights it - i.e. wraps div tags around it to colour it. e.g. [A-Za-z] would be returned as:
Code:
<div class="matchedbracket">[</div>A-Za-z<div class="matchedbracket">]</div>
...highlighting the brackets. The highlighter processes the string stored in the textbox on KeyUp while the user is typing.
I now want to put this string from the highlighter script back into the TextBox, so that the divs are rendered, thus highlighting the brackets. However, what happens is either the div tags are stripped (setValue) resulting in [A-Za-z] again, or the text - including the non-rendered div tags is set back into the TextBox (e.g. <div class="matchedbracket">[</div>A-Za-z<div class="matchedbracket">]</div> as a raw string, rather than actually applying the CSS and colouring it.)
How do I get div tags to apply in an editable TextBox?