title: Save selection text and show it later in html and javascript
body: <p>I have a difficult situation with html and javascript.
  My html page allows user to select text and highlight it with colors. Now I want to save the state into database to show it later for that user. Of course, I can save whole html after user edited it. But I just ONLY want to save some parameters, combine with original html to show the page in the state user see last time. We can use this function: </p>
  
  <pre><code>var index = innerHTML.indexOf(text);
  </code></pre>
  
  <p>to highlight text at that index. But in case there are many same texts in the page, I want to highlight exactly word user highlighted it before.</p>
  
  <p>Anyone can instruct me how to accomplish this with javascript? </p>
  
  <p>I appreciate your help a lot. </p>