Highlighted

get selected text

Avatar

Guest

22-07-2008

given a text field or text input field with following content:

"the fox is brown"



the user selects "fox"



How can I find out in Javascript what the user has selected. I would even accept that the user has to clici a button after selection of a text part to provide an event.



Regards



Martin

Replies

Highlighted

pguerett

22-07-2008

I can only give you the complete text ....I cannot give you what the user has selected because any subsequent action (clicking of the button) will de-select the text.