Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

get selected text

Avatar

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

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

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.