Skip to content

DocumentFragment

Unofficial

Augments the built-in DocumentFragment interface.

Signature:

export interface DocumentFragment extends Node, NonElementParentNode, ParentNode

Extends: Node, NonElementParentNode, ParentNode

Properties

Property Type Description
constructorWin Window Global window object.
(Inherited from Node)
doc Document The document this node belongs to, or the global document.
(Inherited from Node)
win Window The window object this node belongs to, or the global window.
(Inherited from Node)

Methods

Method Returns Description
appendText(val) void Appends a text node to the node.
(Inherited from Node)
createDiv(o?, callback?) HTMLDivElement Creates a new <div> element.
(Inherited from Node)
createEl(tag, o?, callback?) HTMLElementTagNameMap[K] Create an element and append it to this node.
(Inherited from Node)
createSpan(o?, callback?) HTMLSpanElement Creates a new <span> element.
(Inherited from Node)
createSvg(tag, o?, callback?) SVGElementTagNameMap[K] Creates a new svg element such as <svg>, <circle>, <rect>, etc.
(Inherited from Node)
detach() void Detaches the node from the DOM.
(Inherited from Node)
empty() void Empties the node.
(Inherited from Node)
find(selector) Element | null Finds the first descendant element that matches the selector.
findAll(selector) Element[] Finds all descendant elements that match the selector.
indexOf(other) number Returns the index of the node or -1 if the node is not found.
(Inherited from Node)
insertAfter(node, child) T Inserts a child node after the current node.
(Inherited from Node)
instanceOf(type) this is T Cross-window capable instanceof check, a drop-in replacement for instanceof checks on DOM Nodes. Remember to also check for nulls when necessary.
(Inherited from Node)
setChildrenInPlace(children) void Sets the children of the node.
(Inherited from Node)

Links to this page: