I have a bunch of text on my document. You can select word/words from it and highlight the text. After you highlight it, an ajax request is sent and the selected word/words are sent to backend (PHP) and processed to be saved into the database. The page is refreshed and the selected text is permanently higlighted.
Now the bad part, if you higlight "the", it will highlight all the "the"'s in the text document. How do I detect which "the" is higlighted through javascript so that only the proper instance is saved in database.