DocumentFragment
Module: JavaScript DOM API
#include <DocumentFragment.idl>
Inherits from Node, EventTarget
Public Functions
Name | |
---|---|
DocumentFragment | DocumentFragment() |
Element | querySelector(DOMString selectors) Returns the first element that is a descendant of the element on which it is invoked that matches the specified group of selectors. Note: This should be part of the ParentNode interface, which Element implements. |
NodeList | querySelectorAll(DOMString selectors) Returns a static (not live) NodeList of all elements descended from the element on which it is invoked that matches the specified group of CSS selectors. (The base element itself is not included, even if it matches.) Note: This should be part of the ParentNode interface, which Element implements. |
Public Attributes
Name | |
---|---|
readonly attribute NodeList | children A collection rooted at context object matching only element children. Note: This should be part of the ParentNode interface, which Element implements. implements. Note: The return type should be HTMLCollection. |
readonly attribute Element | firstElementChild attributes getter must return the first child that is an element, and null otherwise. Note: This should be part of the ParentNode interface, which Element implements. |
readonly attribute Element | lastElementChild attributes getter must return the last child that is an element, and null otherwise. Note: This should be part of the ParentNode interface, which Element implements. |
readonly attribute Element | nextElementSibling Returns the Element immediately following this node in its parent’s children list, or null if there is no Element in the list following this node. Note: This attribute is part of the NonDocumentTypeChildNode interface, which Element implements. |
readonly attribute unsigned long | childElementCount attributes getter must return the number of children of context object that are elements. Note: This should be part of the ParentNode interface, which Element implements. |
Additional inherited members
Public Functions inherited from Node
Name | |
---|---|
Node | removeChild(Node oldChild) remove a child node |
Node | appendChild(Node newChild) append a node as a child |
void | append((Node or DOMString)… newChildren) append nodes and string objects as children, where the string objects are inserted as equivalent Text nodes |
Node | replaceChild(Node newChild, Node oldChild) replace oldChild with newChild |
Node | insertBefore(Node node, Node? referenceNode) insert a node before the reference node, as a child of the current node |
Node | cloneNode(optional boolean deep =false) |
boolean | isEqualNode(Node? otherNode) |
boolean | isSameNode(Node? otherNode) |
boolean | hasChildNodes() |
boolean | contains(Node? other) |
DOMString | lookupPrefix(DOMString? namespace) |
boolean | isDefaultNamespace(DOMString? namespace) |
void | normalize() |
unsigned short | compareDocumentPosition(Node other) |
Node | getRootNode(optional GetRootNodeOptions options) |
DOMString | lookupNamespaceURI(DOMString? prefix) |
Public Attributes inherited from Node
Name | |
---|---|
const unsigned short | ELEMENT_NODE |
const unsigned short | ATTRIBUTE_NODE |
const unsigned short | TEXT_NODE |
const unsigned short | CDATA_SECTION_NODE |
const unsigned short | ENTITY_REFERENCE_NODE |
const unsigned short | ENTITY_NODE |
const unsigned short | PROCESSING_INSTRUCTION_NODE |
const unsigned short | COMMENT_NODE |
const unsigned short | DOCUMENT_NODE |
const unsigned short | DOCUMENT_TYPE_NODE |
const unsigned short | DOCUMENT_FRAGMENT_NODE |
const unsigned short | NOTATION_NODE |
const unsigned short | DOCUMENT_POSITION_DISCONNECTED |
const unsigned short | DOCUMENT_POSITION_PRECEDING |
const unsigned short | DOCUMENT_POSITION_FOLLOWING |
const unsigned short | DOCUMENT_POSITION_CONTAINS |
const unsigned short | DOCUMENT_POSITION_CONTAINED_BY |
const unsigned short | DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC |
readonly attribute DOMString | nodeName |
attribute DOMString | nodeValue |
attribute DOMString | textContent |
readonly attribute unsigned short | nodeType type of the node |
readonly attribute Node | parentNode parent of the node |
readonly attribute Element | parentElement parent element of the node. If parent is not an Element, returns null. |
readonly attribute NodeList | childNodes list of the children of this node |
readonly attribute Node | firstChild the node’s first child in the tree, or null if the node is childless |
readonly attribute Node | lastChild last child of the node, or null if there are no child elements |
readonly attribute Node | previousSibling the node immediately preceding the specified one in its parent’s children, or null if the specified node is the first in that list |
readonly attribute Node | nextSibling the node immediately following the specified one in its parent’s children, or null if the specified node is the last node in that list |
readonly attribute Document | ownerDocument The Document object associated with this node. This is also the Document object used to create new nodes. When this node is a Document or a DocumentType which is not used with any Document yet, this is null. |
readonly attribute USVString | baseURI |
readonly attribute boolean | isConnected |
Public Functions inherited from EventTarget
Name | |
---|---|
void | addEventListener(DOMInternedString type, EventListener listener, optional boolean useCapture) |
void | removeEventListener(DOMInternedString type, EventListener listener, optional boolean useCapture) |
boolean | dispatchEvent(Event event) |
Public Functions Documentation
function DocumentFragment
DocumentFragment DocumentFragment()
function querySelector
Element querySelector(
DOMString selectors
)
Returns the first element that is a descendant of the element on which it is invoked that matches the specified group of selectors. Note: This should be part of the ParentNode interface, which Element implements.
function querySelectorAll
NodeList querySelectorAll(
DOMString selectors
)
Returns a static (not live) NodeList of all elements descended from the element on which it is invoked that matches the specified group of CSS selectors. (The base element itself is not included, even if it matches.) Note: This should be part of the ParentNode interface, which Element implements.
Public Attributes Documentation
variable children
readonly attribute NodeList children;
A collection rooted at context object matching only element children. Note: This should be part of the ParentNode interface, which Element implements. implements. Note: The return type should be HTMLCollection.
variable firstElementChild
readonly attribute Element firstElementChild;
attributes getter must return the first child that is an element, and null otherwise. Note: This should be part of the ParentNode interface, which Element implements.
variable lastElementChild
readonly attribute Element lastElementChild;
attributes getter must return the last child that is an element, and null otherwise. Note: This should be part of the ParentNode interface, which Element implements.
variable nextElementSibling
readonly attribute Element nextElementSibling;
Returns the Element immediately following this node in its parent’s children list, or null if there is no Element in the list following this node. Note: This attribute is part of the NonDocumentTypeChildNode interface, which Element implements.
variable childElementCount
readonly attribute unsigned long childElementCount;
attributes getter must return the number of children of context object that are elements. Note: This should be part of the ParentNode interface, which Element implements.