Document
Extends:
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public get |
body: * |
|
public set |
body: * |
|
public get |
|
|
public get |
head: * |
|
public get |
location: * |
|
public set |
location: * |
|
public get |
textContent: * textContent returns null if the element is a document, a document type, or a notation. |
Method Summary
Public Methods | ||
public |
appendChild(child: Node): Node |
|
public |
createComment(data: string): Comment Creates a new Comment. |
|
public |
Creates a new empty DocumentFragment. |
|
public |
createElement(name: string): HTMLElement Creates a new element with the given tag name. |
|
public |
createTextNode(textContent: string): Text Creates a text node. |
|
public |
getElementById(id: string): Element Returns a reference to the element by its ID. |
|
public |
getElementsByClassName(className: *): * |
|
public |
getElementsByTagName(tagName: string): HTMLCollection Returns an HTMLCollection of elements with the given tag name. |
|
public |
querySelector(selector: string): Element Returns the first element within the document (using depth-first pre-order traversal of the document's nodes|by first element in document markup and iterating through sequential nodes by order of amount of child nodes) that matches the specified group of selectors. |
|
public |
querySelectorAll(selector: string): NodeList Returns a list of the elements within the document (using depth-first pre-order traversal of the document's nodes) that match the specified group of selectors. The object returned is a NodeList. |
Inherited Summary
From class Node | ||
public get |
|
|
public set |
nodeValue(value: *): * |
|
public get |
Returns the Document that this node belongs to. |
|
public get |
|
|
public |
addEventListener(eventType: string, listener: function, capturingPhase: boolean): * |
|
public |
dispatchEvent(event: Event): boolean |
|
public |
getAttribute(attributeName: string): string get attribute's value |
|
public |
hasAttribute(attributeName: string): boolean checks if attribute exists for node |
|
public |
removeAttribute(attributeName: string) remove attribute |
|
public |
removeEventListener(eventType: string, listener: function, capturingPhase: boolean): boolean |
|
public |
setAttribute(attributeName: string, attributeValue: string) set attribute's value |
From class ParentNode | ||
public get |
childNodes: Node[] TODO return {HTMLCollection} |
|
public get |
firstChild: Node | null |
|
public get |
|
|
public get |
nextSibling: Node | null |
|
public get |
parentNode: Node | null |
|
public get |
|
|
public |
appendChild(child: Node): Node |
|
public |
Clone a Node, and optionally, all of its contents. |
|
public |
Method returns true if node has child nodes. |
|
public |
insertBefore(child: Node, existingChild: Node): Node |
|
public |
removeChild(toRemoveChild: Node): Node |
|
public |
replaceChild(newChild: Node, oldChild: Node): Node |
|
protected |
_createCollection(selector: *): * Inner method to create new live HTMLCollection. |
Public Constructors
Public Members
public get body: * source
public set body: * source
public get documentElement: * source
public get head: * source
public get location: * source
public set location: * source
public get textContent: * source
textContent returns null if the element is a document, a document type, or a notation.
Override:
Node#textContentPublic Methods
public appendChild(child: Node): Node source
Override:
ParentNode#appendChildParams:
Name | Type | Attribute | Description |
child | Node |
public createComment(data: string): Comment source
Creates a new Comment.
Params:
Name | Type | Attribute | Description |
data | string |
public createElement(name: string): HTMLElement source
Creates a new element with the given tag name.
Params:
Name | Type | Attribute | Description |
name | string |
public createTextNode(textContent: string): Text source
Creates a text node.
Params:
Name | Type | Attribute | Description |
textContent | string |
public getElementById(id: string): Element source
Returns a reference to the element by its ID.
Params:
Name | Type | Attribute | Description |
id | string | case-sensitive string representing the unique ID of the element being sought |
Return:
Element | reference to an Element, or null if an element with the specified ID is not in the document. |
public getElementsByClassName(className: *): * source
Params:
Name | Type | Attribute | Description |
className | * |
Return:
* |
public getElementsByTagName(tagName: string): HTMLCollection source
Returns an HTMLCollection of elements with the given tag name. The complete document is searched, including the root node. The returned HTMLCollection is live, meaning that it updates itself automatically to stay in sync with the DOM treewithout having to call document.getElementsByTagName() again.
Params:
Name | Type | Attribute | Description |
tagName | string |
public querySelector(selector: string): Element source
Returns the first element within the document (using depth-first pre-order traversal of the document's nodes|by first element in document markup and iterating through sequential nodes by order of amount of child nodes) that matches the specified group of selectors.
Params:
Name | Type | Attribute | Description |
selector | string |
public querySelectorAll(selector: string): NodeList source
Returns a list of the elements within the document (using depth-first pre-order traversal of the document's nodes) that match the specified group of selectors. The object returned is a NodeList.
Params:
Name | Type | Attribute | Description |
selector | string |