title: Contenteditable text editor and cursor position
body: <p>How can I (using jquery or other) insert html at the cursor/caret position of my contenteditable div:</p>
  
  <pre><code>&lt;div contenteditable="true"&gt;Hello world&lt;/div&gt;
  </code></pre>
  
  <p>For example, if the cursor/caret was between "hello" and "world" and the user then clicked a button, eg "insert image", then using javascript, something like <code>&lt;img src=etc etc&gt;</code> would be inserted between "hello" and "world". I hope I've made this clear =S</p>
  
  <p>Example code would be greatly appreciated, thanks a lot!</p>