I'm developing a toolbar for Internet Explorer...
One of its functions, is to surround text in a text area with attributes....
In other words... if the user is typing something (like this question I'm typing),
then he/she selects a sentence like: Word Word Word Word
then click a button on toolbar that will "process" the selected word/sentence...
By process I mainly mean adding an attribute before/after the sentence...
so it becomes something like:
[b] Word Word Word Word [/b]
or <i > Word Word Word Word </i >
So my questions:
- how to get the selected text only (not the un-selected text in the same textbox)... ?
- Once the string is captured, how to return the selected/marked text to the textbox with the attributes??
I hope I was able to explain what I need :)