title: insert text before and after at selected text
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4770457/insert-text-before-and-after-the-selected-text-in-javascript">Insert text before and after the selected text in javascript</a>  </p>
  </blockquote>
  
  
  
  <p>I want to put some specified text (where possible in iframe when designmode on) before and after any selected text in an HTML <code>document. document.getSelection()</code> or <code>document.selection.createRange().text</code> returns only the text itself not the position.</p>
  
  <p>Is there anyway to replace the selected text? </p>
  
  <p>Anyway to insert specific text before and after selcted text anywhere in the document?</p>