WebIDLpedia

DocumentFragment interface

Definition

DOM Standard defines DocumentFragment


DocumentFragment includes NonElementParentNode;
DocumentFragment includes ParentNode;

[Exposed=Window]
interface DocumentFragment : Node {
  constructor();
};
Consolidated IDL (across mixin and partials)


[Exposed=Window]
interface DocumentFragment : Node {
  constructor();
  Element? getElementById(DOMString elementId);
  [SameObject] readonly attribute HTMLCollection children;
  readonly attribute Element? firstElementChild;
  readonly attribute Element? lastElementChild;
  readonly attribute unsigned long childElementCount;

  [CEReactions, Unscopable] undefined prepend((Node or TrustedScript or DOMString)... nodes);
  [CEReactions, Unscopable] undefined append((Node or TrustedScript or DOMString)... nodes);
  [CEReactions, Unscopable] undefined replaceChildren((Node or TrustedScript or DOMString)... nodes);

  Element? querySelector(DOMString selectors);
  [NewObject] NodeList querySelectorAll(DOMString selectors);
};

Methods and attributes that return objects implementing DocumentFragment

Referring IDL interfaces/dictionaries

Referring specifications