XML DOM cloneContents() method

Definition and usage

cloneContents() method copies the content of the range (Range) to a DocumentFragment object.

Syntax:

extractContents()

Return value

A DocumentFragment node, containing a copy of the document content within the range.

throw

If the current range includes DocumentType nodeThis method will throw an error code of HIERARCHY_REQUEST_ERR DOMException exception.

Description

This method will copy the content of the current range and store it in a DocumentFragment objectReturns this object in.