title: How to add / insert / update text inside contenteditable div at a particular position?
body: <p>The HTML code looks like this</p>
  
  <pre><code>&lt;div id="txtarea" contenteditable="true"&gt;Some text&lt;/div&gt;
  </code></pre>
  
  <p>I have to insert some new text based on some event at a particular position in the above div.
  The event calls the function say updateDiv(txt, positon). For example it says<br>
  <code>updateDiv("more ",5);</code></p>
  
  <p>So the div should become be</p>
  
  <pre><code>&lt;div id="txtarea" contenteditable="true"&gt;Some more text&lt;/div&gt;
  </code></pre>
  
  <p>I tried a lot of javascript and jquery but nothing seem to work.</p>