title: internet explorer alternative to document.execCommand("insertText",...), for text insertion that can be undone/redone by the user
body: <p>When the user edits a <code>contenteditable div</code>, and press some keys, I would like to override the default behavior.
  For instance, I want to insert a normal line break when the user press ENTER.
  I do that using <code>document.execCommand("insertText",...)</code></p>
  
  <p>This is the only way I have found so far to make this action <strong>undoable</strong> and <strong>redoable</strong> by the user.</p>
  
  <pre><code>&lt;div id="editor" contenteditable="true" style="white-space:pre-wrap"&gt;
  Some text....
  &lt;/div&gt;
  
  &lt;script&gt;
  $("#editor").keydown(function(evt){
      console.log(evt.keyCode);
      if(evt.keyCode==13){
          document.execCommand("insertText",false,"\n");
          evt.preventDefault();
          evt.stopPropagation();
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>This code works well on chrome and firefox. But, ie does not support "inserttext". Would there be a way to insert text with ie, such that the user can <strong>undo</strong> it?</p>