I'm trying to accomplish something I believe should be simple to do in jQuery.
I have a long text in my website. Whenever a user selects (highlights) a text, I need to get the following info:
- The paragraph where the selection begins at
- The char in that paragraph that the selection starts at
- The length of the selection
- The paragraph where the selection ends at (in case the highlight goes beyond one paragraph)
- The char in that paragraph where the selection ends
Thanks ahead ;)