title: Select range in contenteditable div
body: <p>I've got a <code>contenteditable</code> div and a few paragraphs in it.</p>
  
  <p>Here's my code:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="main" contenteditable="true" 
               style="border:solid 1px black; width:300px; height:300px"&gt;
              &lt;div&gt;Hello world!&lt;/div&gt;
              &lt;div&gt;
                  &lt;br&gt;
              &lt;/div&gt;
              &lt;div&gt;This is a paragraph&lt;/div&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Assuming, I want to make a range selection which will contain the string "world! This is"</p>
  
  <p>How to do that?</p>