title: Keep selection made on editable DIV when focus is on other element
body: <p>I have had this problem for a long time and I just can't figure out how to fix it. I want to create a simple WYSYWYG editor and I have some problems.</p>
  
  <p>Currently I have this:</p>
  
  <pre><code>&lt;div id="editor" contenteditable="true"&gt;&lt;/div&gt;
  &lt;input type="button" value="B" 
         onmousedown="document.execCommand('bold',false,null); return false;"/&gt;
  </code></pre>
  
  <p>So, if I have some text inside my DIV, select it and click on "B" it is converted to BOLD, and remains selected, but this doesn't work on Opera and IE.  </p>
  
  <p>I just don't know how to make the editable DIV not only keep the focus but also the text selection.</p>
  
  <p>Any idea? </p>