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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

get selected text


Not applicable
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.


1 Reply


Level 10
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.