title: Set caret position in contenteditable div layer in Chrome/webkit
body: <p>I'm trying to set the caret position in a contenteditable div layer, and after a bit of searching the web and experimenting I got it to work in firefox using this:</p>
  
  <pre><code>function set(element,position){
      element.focus();
      var range= window.getSelection().getRangeAt(0);
      range.setStart(element.firstChild,position);
      range.setEnd(element.firstChild,position);
  }
  
  [...]
  
  set(document.getElementById("test"),3);
  </code></pre>
  
  <p>But in Chrome/webkit it selects all of the content in the div.  Is this a bug with webkit or am I doing something wrong?<br>
  Thank you in advance.</p>