i need to highlight all the occurrences of a string in particular div by selecting a string,
once i select a word and click a button it need to highlight all its occurrence inside a div,
eg - if i select
cricket is game
You can get the browser to do the hard work for you using a
TextRange in IE and
window.find() in other browsers.
This answer shows how to do it. It will match text that crosses element boundaries and does the highlighting for you using