Reputation: 8379
If I use the below code I am able to highlight the found text in Window.
window.find(str);
But if I search for another string with window.find()
the previous highlight will be removed. But how can I change that to not remove old highlights..
Upvotes: 1
Views: 787
Reputation: 324617
You can use document.execCommand()
to add styling to the current selection after calling window.find()
. See my answer here, for example:
https://stackoverflow.com/q/5887719/96100
Upvotes: 1