Creates a DocumentFragment object, copies the contents of the current Range object into it and removes the contents of current Range from the document tree.

Note: The Range object and its extractContents method are supported in Internet Explorer from version 9.

The DocumentFragment object is a context-free container that is similar to the document object.
The DocumentFragment element is useful if you want to create complex HTML content, where you can find, replace, remove or insert elements, and when you are done, the contents can be inserted into the document tree.

The cloneContents method is similar to the extractContents method, it also creates a DocumentFragment object from the contents of a Range object, but it does not remove the contents of the Range from the document tree.
To remove the contents of a Range from the document tree, use the deleteContents method.