I\'m trying to highlight a piece of text in a \"Textarea\". I have a long string in that TextArea:
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
I remember seeing this a while ago... http://www.din.or.jp/~hagi3/JavaScript/JSTips/Mozilla/Samples/NSHTMLTextAreaElement.htm
Its quite complicated and I could never quite be bothered to get my head round it. Dunno if this is what you need, or if you can use it at all. :)