predi
10-17-2005, 06:29 AM
Hi,
Im trying to do such thing:
in a text area when you select text and press a button the selected text is bolded or underlined or simmilar. Its the same as in this forum when you are posting or making a new thread, you have that ability to underline your words by selecting them and pressing 'U' button.
Well the problem is that I manage to do that but there's a little drawback.
If for example I have This text:
"Javascript is Javascript".
If I want to underline the SECOND word "Javascript", I select it and I get:
"<u>Javascript</u> is <u>Javascript</u>".
I use simple replace method.
How do I make only the second word "javascript" be underlined? I mean how to identify wich word is selected?
Im trying to do such thing:
in a text area when you select text and press a button the selected text is bolded or underlined or simmilar. Its the same as in this forum when you are posting or making a new thread, you have that ability to underline your words by selecting them and pressing 'U' button.
Well the problem is that I manage to do that but there's a little drawback.
If for example I have This text:
"Javascript is Javascript".
If I want to underline the SECOND word "Javascript", I select it and I get:
"<u>Javascript</u> is <u>Javascript</u>".
I use simple replace method.
How do I make only the second word "javascript" be underlined? I mean how to identify wich word is selected?