Hello :)
I need to get the selection position by js and make sure that this code work for all the browsers.

For example, the user selected this text (red text is selected):
Hello world
The function should return to me array or two values wich they are: 3,9 (start and end position of the selection)

Thanks and sory for bad english.

Recommended Answers

All 2 Replies

Member Avatar for stbuchok

look at the onselect event for javascript.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.