I'm doing some in page highlighting, and found the most popular example when using text selection and adding spans is by switching to designMode and running execCommand
How can I highlight the text of the DOM Range object?
There's no follow up though on how to remove the span tags once created. I saw some examples using jquery and the replaceWith, but none with straight javascript.