How do I take a selection from window.getSelection().getRangeAt(0) and surround it with an HTML tag such as \'span\' or \'mark\'? I prefer a straight javascript or jQuery so
(Answering my own question based on a similar question I found when I posted mine...)
The guys in this Q&A thread were on an interesting track. It just used a different format than I was looking for. Modifying their code, I was able to do the following:
Display Range |
Mark Range
This is sample text. You should be able to type in this box or select anywhere in this div and then click the link at the top to get the selected range.