title: Converting Range or DocumentFragment to string
body: <p>Is there a way to get the html string of a JavaScript Range Object in W3C compliant browsers?</p>
  
  <p>For example, let us say the user selects the following: <code>Hello &lt;b&gt;World&lt;/b&gt;</code><br>
  It is possible to get "Hello World" as a string using the <code>Range.toString()</code> method.
  (In Firefox, it is also possible using the <em>document</em>'s <code>getSelection</code> method.)</p>
  
  <p>But I can't seem to find a way to get the inner HTML.</p>
  
  <p>After some searching, I've found that the range can be converted to a <code>DocumentFragment</code> Object.</p>
  
  <p>But <code>DocumentFragments</code> have no <code>innerHTML</code> property (at least in Firefox; have not tried Webkit or Opera).<br>
  Which seems odd to me: It would seem obvious that there should be some way to acces the selected items.</p>
  
  <p>I realize that I can create a <code>documentFragment</code>, append the document fragment to another element, and then get the <code>innerHTML</code> of that element.<br>
  But that method will auto close any open tags within the area I select.<br>
  Besides that there surely is an obvious "better way" than attaching it to the dom just to get it as a string.</p>
  
  <p>So, how to get the string of the html of a Range or DocFrag?</p>