Jason Kirk wrote:
I'm going to be using a textarea to edit some XML data. It would make my
life easier if I could add some really simple dynamic syntax highlighting
to the textarea. Is this possible with javascript?
I suspect I'll have to hackdown a RTE wysiwyg script, but I'd rather just
stick with a nice simple textarea if I can.
The content of a textarea elements is PCDATA. General HTML markup is
ignored but character entities are not (at least in all the browsers I
tested).
For example:
<textarea><B>blah</B></textarea> --> <B>blah</B>
<textarea>&blah></textarea> --> &blah>
Also:
<textarea>blah \n blah</textarea> --> blah \n blah
and (when clicked on):
<textarea onclick="this.value="blah\nblah">
--> blah
blah
--
Rob