asp.net.ph

Skip Navigation Links

createDocumentFragment Method

DHTML Methods


Creates a new instance of the document object.

Syntax

oFragment = document.createDocumentFragment ( ) 
Return Value

Returns a new document object.

Remarks

The createDocumentFragment method allows an author to create a document fragment. A document fragment is a minimal document object that can be used to store portions of a document tree. For example, to rearrange the contents of a document ( at run time ) , those fragments would need to be placed in a temporary location. While storing portions of the document tree in a node on the document object works, the document object can potentially be quite large. Using a document fragment, portions of the document tree, or a new sub tree altogether, can be created and organized, then inserted into the document.

The children of a document fragment node are zero or more nodes representing the tops of any sub-trees. When a document fragment is inserted into the document object, or any other node that can have children, the children of the document fragment, but not the document fragment itself, are inserted into the node.

Applies To

document

See Also

createElement



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note