How to add onclick or onselect functions to HTML Textarea ?

How to add onclick or onselect functions to HTML Textarea ?

ni eswar krishna -
Number of replies: 1
Hi,
I want to add onselect function to HTML Textarea to get the selected text from the textarea. I tried for ordinary textarea & its working, but when I apply the same code to the HTML Textarea, its not working?

After adding rich text editor,

 <textarea id="summary" name="textarea" cols="70" rows="20" onselect="func()">

            But func() is not being called !Please help me how to add javascript functions for HTML Textarea?
Even I want to implement Auto save feature for the the rich text editor, but Im facing the same problem.
Please Help me.

Thanks in advance.
Average of ratings: -
In reply to eswar krishna

Re: How to add onclick or onselect functions to HTML Textarea ?

ni Janne Mikkonen -
If I understood your question right, you're trying to get selected text from HTMLArea and not into it?

HTMLArea is not actually a textarea element but iframe. So the key word is:
window.frames[<frame>].document.<selection method>

- Janne -