Text
charging?: boolean;
chargingTime?: number;
dischargingTime?: number;
level?: number;
data: string;
length: number;
ownerDocument: Document;
appendData(data: string): void;
deleteData(offset: number, count: number): void;
insertData(offset: number, data: string): void;
replaceData(offset: number, count: number, data: string): void;
substringData(offset: number, count: number): string;
after(...nodes: (string | Node)[]): void;
before(...nodes: (string | Node)[]): void;
remove(): void;
replaceWith(...nodes: (string | Node)[]): void;
addEventListener(
type: string,
callback: null | EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void;
dispatchEvent(event: Event): boolean;
removeEventListener(
type: string,
callback: null | EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void;
baseURI: string;
childNodes: NodeListOf<ChildNode>;
firstChild: null | ChildNode;
isConnected: boolean;
lastChild: null | ChildNode;
nextSibling: null | ChildNode;
nodeName: string;
nodeType: number;
nodeValue: null | string;
parentElement: null | HTMLElement;
parentNode: null | ParentNode;
previousSibling: null | ChildNode;
textContent: null | string;
appendChild<T extends Node>(node: T): T;
cloneNode(subtree?: boolean): Node;
compareDocumentPosition(other: Node): number;
contains(other: null | Node): boolean;
getRootNode(options?: GetRootNodeOptions): Node;
hasChildNodes(): boolean;
insertBefore<T extends Node>(node: T, child: null | Node): T;
isDefaultNamespace(namespace: null | string): boolean;
isEqualNode(otherNode: null | Node): boolean;
isSameNode(otherNode: null | Node): boolean;
lookupNamespaceURI(prefix: null | string): null | string;
lookupPrefix(namespace: null | string): null | string;
normalize(): void;
removeChild<T extends Node>(child: T): T;
replaceChild<T extends Node>(node: Node, child: T): T;
ELEMENT_NODE: 1;
ATTRIBUTE_NODE: 2;
TEXT_NODE: 3;
CDATA_SECTION_NODE: 4;
ENTITY_REFERENCE_NODE: 5;
ENTITY_NODE: 6;
PROCESSING_INSTRUCTION_NODE: 7;
COMMENT_NODE: 8;
DOCUMENT_NODE: 9;
DOCUMENT_TYPE_NODE: 10;
DOCUMENT_FRAGMENT_NODE: 11;
NOTATION_NODE: 12;
DOCUMENT_POSITION_DISCONNECTED: 1;
DOCUMENT_POSITION_PRECEDING: 2;
DOCUMENT_POSITION_FOLLOWING: 4;
DOCUMENT_POSITION_CONTAINS: 8;
DOCUMENT_POSITION_CONTAINED_BY: 16;
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
nextElementSibling: null | Element;
previousElementSibling: null | Element;
assignedSlot: null | HTMLSlotElement;
wholeText: string;
splitText(offset: number): Text;
}
Hierarchy (View Summary)
Index
Properties
Methods
Properties
Optional
charging
Optional
charging Time
Optional
discharging Time
Optional
level
data
Readonly
length
Readonly
owner Document
Returns the node document. Returns null for documents.
Readonly
base URI
Returns node's node document's document base URL.
Readonly
child Nodes
Returns the children.
Readonly
first Child
Returns the first child.
Readonly
is Connected
Returns true if node is connected and false otherwise.
Readonly
last Child
Returns the last child.
Readonly
next Sibling
Returns the next sibling.
Readonly
node Name
Returns a string appropriate for the type of node.
Readonly
node Type
Returns the type of node.
node Value
Readonly
parent Element
Returns the parent element.
Readonly
parent Node
Returns the parent.
Readonly
previous Sibling
Returns the previous sibling.
text Content
Readonly
ELEMENT_ NODE
node is an element.
Readonly
ATTRIBUTE_ NODE
Readonly
TEXT_ NODE
node is a Text node.
Readonly
CDATA_ SECTION_ NODE
node is a CDATASection node.
Readonly
ENTITY_ REFERENCE_ NODE
Readonly
ENTITY_ NODE
Readonly
PROCESSING_ INSTRUCTION_ NODE
node is a ProcessingInstruction node.
Readonly
COMMENT_ NODE
node is a Comment node.
Readonly
DOCUMENT_ NODE
node is a document.
Readonly
DOCUMENT_ TYPE_ NODE
node is a doctype.
Readonly
DOCUMENT_ FRAGMENT_ NODE
node is a DocumentFragment node.
Readonly
NOTATION_ NODE
Readonly
DOCUMENT_ POSITION_ DISCONNECTED
Set when node and other are not in the same tree.
Readonly
DOCUMENT_ POSITION_ PRECEDING
Set when other is preceding node.
Readonly
DOCUMENT_ POSITION_ FOLLOWING
Set when other is following node.
Readonly
DOCUMENT_ POSITION_ CONTAINS
Set when other is an ancestor of node.
Readonly
DOCUMENT_ POSITION_ CONTAINED_ BY
Set when other is a descendant of node.
Readonly
DOCUMENT_ POSITION_ IMPLEMENTATION_ SPECIFIC
Readonly
next Element Sibling
Returns the first following sibling that is an element, and null otherwise.
Readonly
previous Element Sibling
Returns the first preceding sibling that is an element, and null otherwise.
Readonly
assigned Slot
Readonly
whole Text
Returns the combined data of all direct Text node siblings.
Methods
append Data
appendData(data: string): void
delete Data
deleteData(offset: number, count: number): void
insert Data
insertData(offset: number, data: string): void
replace Data
replaceData(offset: number, count: number, data: string): void
substring Data
substringData(offset: number, count: number): string
after
before
remove
remove(): void
Removes node.
Returns void
replace With
add Event Listener
addEventListener(
type: string,
callback: null | EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
Parameters
type: string
callback: null | EventListenerOrEventListenerObject
Optional
options: boolean | AddEventListenerOptions
Returns void
dispatch Event
remove Event Listener
removeEventListener(
type: string,
callback: null | EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void
Removes the event listener in target's event listener list with the same type, callback, and options.
Parameters
type: string
callback: null | EventListenerOrEventListenerObject
Optional
options: boolean | EventListenerOptions
Returns void
append Child
clone Node
compare Document Position
contains
get Root Node
getRootNode(options?: GetRootNodeOptions): Node
has Child Nodes
hasChildNodes(): boolean
Returns whether node has children.
Returns boolean
insert Before
is Default Namespace
isDefaultNamespace(namespace: null | string): boolean
is Equal Node
is Same Node
isSameNode(otherNode: null | Node): boolean
lookup Namespace URI
lookupNamespaceURI(prefix: null | string): null | string
lookup Prefix
lookupPrefix(namespace: null | string): null | string
normalize
normalize(): void
Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.
The textual content of Element or Attr. If an element has no markup within its content, it has a single child implementing Text that contains the element's text. However, if the element contains markup, it is parsed into information items and Text nodes that form its children.
MDN Reference