[jQuery] Highlight text, then apply element around selection

[jQuery] Highlight text, then apply element around selection


I would like to be able to select some text with my cursor, then click
a button to execute code that will wrap that selection in a tag that I
specify, such as a span.
I know this is possible, but I am a little lost as to where I should
start.