Highlight text stored in cookie with javascript
<p>Hi guys i have to do these tasks with javascript. i have tried several ways but none of them worked.</p>

<ol>
<li>highlight selected text -done</li>
<li><p>store highlighted text's start and end index in cookie so that if user comes again to this page in same session then it should be highlighted- done</p></li>
<li><p>*<strong><em>now i have start and end index of the text in a cookie in the document i have to highlight that text</em>*</strong>  i have stored start and end index in two arrays from cookie.</p></li>
</ol>

<p>if i store text in the cookie and on page load replace it with formatted text then i would replace first occurrence of the text which may be the text which is not the next whose start index and end index is sored in array.</p>

<p>i have to find some other way which takes start and end index for highligting the text</p>

<p>plz help</p>
