0

I have a textarea in my application and a DIV which contains the text of that textarea plus some SPANS for highlighting. I'd like to be able to select some text in the textarea, click a button, and have that button highlight that exact text only in the DIV.

I've been trying to accomplish this by creating a new range and using the startOffset and endOffset properties of the textarea selection, but I can't quite get it to work. Is this possible and if so how would you go about it?

0 Answers0