extractContents
Moves contents of a Range from the document tree into a document fragment.
Syntax
documentFragment is a document fragment
Example
range = document.createRange(); range.selectNode(document.getElementsByTagName("div").item(0)); documentFragment = range.extractContents(); document.body.appendChild(documentFragment);
Notes
Event Listeners added using DOM Events are not retained during extraction. HTML attribute events are retained or duplicated as they are for the DOM Core cloneNode method. HTML id attributes are also cloned, which can lead to an invalid document if a partially-selected node is extracted and appened to the document.
Partially selected nodes are cloned to include the parent tags necessary to make the document fragment valid.
Specification:
Netscape Communications http://developer.netscape.com |