How to find the selection text beginning and end positions in Javascript?

前端 未结 3 542
孤城傲影
孤城傲影 2021-01-06 03:51

I am trying to find the textual start and end of the selection. So, in the following text, if I selected \"world! What a fine\" from within \"Hello, world! What a fine day

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-06 04:46

    But I know a jQuery plugin that aims your problem and much more - https://github.com/localhost/jquery-fieldselection

提交回复
热议问题