Can I start the start selection through javascript / jQuery?
In my opinion, the choice of mouse text can be divided into the following steps:
1) raise the mousedown event and start the selection
2) run mousemove and move the "endpoint" of the selection
3) call the mouse and stop the selection
Only step 1) can be called, i.e. the text in the span element ... ... so after that the moving mouse cursor will behave like a selection waiting for the mouse?
Or , how is it implemented and how does the browser know that the choice is starting?
Rangy library: I know this javascript library for creating custom range selection. But it seems too complicated for me to imitate my own choice through mouse events. I just want to tell the browser that I started choosing in (span, offset 2), and it should continue in step .
source share