title: Add element before/after text selection
body: <p>I'm looking for function which allows me to build some element before or after selected text. Something similar like this one <a href="https://stackoverflow.com/questions/5393922/javascript-replace-selection-all-browsers">javascript replace selection all browsers</a> but for adding some content before or after selection instead of replacing it, like <code>after()</code> and <code>before()</code> jQuery methods. Should I use some DOM selection method, if yes which one? Or does exist something easier to carry it out?</p>