Let's assume that I have the following text within a single <p>... </p>
When a user selects a couple of words within the text, lets assume the first Quisque vestibulum
is selected, I get the selected text with window.getSelection().toString();
then I apply some CSS tricks, lets say I underline the text.
When the user comes back one month later, I would like to underline same text again. How can I get an exact reference for the selected text for future reference? I don't want to highlight the second Quisque vestibulum
.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum at dolor sit amet augue tempor venenatis vitae et nibh. Donec dignissim fringilla fermentum. In facilisis consectetur risus. Nam vel mauris magna, a feugiat nisl. Quisque vestibulum, neque eu tristique tristique, tortor mauris ornare magna, at ultricies augue orci sed enim. Nulla magna ligula, dapibus vel commodo ac, sodales ut sem. Duis lorem massa, consectetur sed molestie eget, posuere eu magna. Pellentesque sollicitudin mattis facilisis. Nunc pulvinar metus et diam dignissim sit amet pellentesque metus pretium. Quisque vestibulum, maecenas vel leo sit amet diam iaculis sollicitudin.