Hi I am highlighting text through window.find and selectRange methods. And I am using below code to remove highlights.. But it does not seems to work..
if (window.getSelection) {
window.getSelection().removeAllRanges();
} else if (document.selection) {
document.selection.empty();
}
Please let me know mistakes in this code
here is the fiddle.
You can do it this way: http://jsfiddle.net/qmR5m/7/
What I did was simply strip the body text of spans with the class “Apple-style-span”.