lucienne
06-20-2003, 02:24 AM
I'm trying to figure out how to apply a piece of code around a selected text in a textarea. For instance:
a textarea has the following text:
"Hi my name is"
I select the text "name"
When I press a button I want the tags <b></b> around the selected text "name".
I have a script to put the tags in the textarea I just don't know how to get the tags around the selected word.
Does anybody have an idea?
a textarea has the following text:
"Hi my name is"
I select the text "name"
When I press a button I want the tags <b></b> around the selected text "name".
I have a script to put the tags in the textarea I just don't know how to get the tags around the selected word.
Does anybody have an idea?