Programmer's Guide > Interfaces > W3C Range interface > extractContents method
  
extractContents method
Moves the contents of a Range from the containing document or document fragment to a new DocumentFragment.
extractContents( )
Parameters
None
Returns
DocumentFragment. A DocumentFragment containing the extracted contents.
Throws
DOMException
NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of the content of the Range is read-only or any of the nodes which contain any of the content of the Range are read-only.
HIERARCHY_REQUEST_ERR: Raised if a DocumentType node would be extracted into the new DocumentFragment.
INVALID_STATE_ERR: Raised if detach() has already been invoked on this object.