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
But I know a jQuery plugin that aims your problem and much more - https://github.com/localhost/jquery-fieldselection