The Node
is an interface from which various types of DOM API
objects inherit, allowing us to treat these different types of objects in a similar manner.
Node.prototype.baseURI
: Read-only, returns aDOMString
representing thebase URL
. The concept ofbase URL
varies in different languages, inHTML
it represents the protocol and domain, and also the file directory up to the last/
.Node.prototype.baseURIObject
: Read-onlynsIURI
object representing the element'sbase URI
(not applicable to web content).Node.prototype.childNodes
: Read-only, returns a liveNodeList
containing all child nodes of the node. TheNodeList
is dynamically updated, if the node's child nodes change, theNodeList
object will automatically update.Node.prototype.firstChild
: Read-only, returns the first childNode
of the node, returnsnull
if the node has no child nodes.Node.prototype.isConnected
: Read-only, returns a boolean value to check if the node is connected (directly or indirectly) to a context object, such as theDocument
object in usualDOM
scenarios, or theShadowRoot
object inshadow DOM
scenarios.Node.prototype.lastChild
: Read-only, returns the last childNode
of the node, returnsnull
if the node has no child nodes.Node.prototype.nextSibling
: Read-only, returns the next siblingNode
of the node at the same level, returnsnull
if none exists.Node.prototype.nodeName
: Read-only, returns aDOMString
containing the name of the node. The structure of the node's name varies with the node type. The name of anHTMLElement
corresponds to the associated tag, for example,HTMLAudioElement
isaudio
,Text
node corresponds to#text
, and theDocument
node corresponds to#document
.Node.prototype.nodeType
: Read-only, returns an unsigned short integer value corresponding to the node type.Node.prototype.nodeValue
: Returns or sets the value of the current node.Node.prototype.ownerDocument
: Read-only, returns theDocument
object to which the element belongs. If there is no associatedDocument
object, it returnsnull
.Node.prototype.parentNode
: Read-only, returns the parentNode
of the current node. If there is no such node, for example if the node is the top of a tree structure or not inserted into a tree, this property returnsnull
.Node.prototype.parentElement
: Read-only, returns the parentElement
of the current node. If the current node has no parent node or the parent node is not anElement
, this property returnsnull
.Node.prototype.previousSibling
: Read-only, returns the previous siblingNode
of the current node, returnsnull
if no such node exists.Node.prototype.textContent
: Returns or sets the text content of all child nodes and their descendants within an element.
Node.prototype.appendChild()
: Appends the specifiedchildNode
as the last child to the current node. If the parameter references an existing node in theDOM
tree, the node will be detached from its current position and appended to the new position.Node.prototype.cloneNode()
: Clones aNode
, and the option to choose whether to clone all the content under this node is available. By default, the content under the node will be cloned.Node.prototype.compareDocumentPosition()
: Compares the position of the current node with another node in the document.Node.prototype.contains()
: Returns aBoolean
value to indicate whether the passed-in node is a descendant of the node.Node.prototype.getRootNode()
: Returns the root node of the context object. If ashadow root
node exists, it can also be included in the returned node.Node.prototype.hasChildNodes()
: Returns aBoolean
value to indicate whether the element has child nodes.Node.prototype.insertBefore()
: Adds a child nodeNode
under the current node and positions it in front of the reference node.Node.prototype.isDefaultNamespace()
: Returns aBoolean
value, accepting a namespaceURI
as a parameter. It returnstrue
when the namespace referred to by the parameter is the default namespace, otherwise, it returnsfalse
.Node.prototype.isEqualNode()
: Returns aBoolean
value. It returnstrue
when twonode
nodes are of the same type and their defined data points match (i.e., same attributes and attribute values, same node values), otherwise, it returnsfalse
.Node.prototype.isSameNode()
: Returns aBoolean
value, providing the result of comparing the references of these two nodes.Node.prototype.lookupPrefix()
: Returns aDOMString
containing the namespace prefix corresponding to the parameterURI
, ornull
if it doesn't exist. If multiple matching prefixes exist, the result returned depends on the specific browser implementation.Node.prototype.lookupNamespaceURI()
: Accepts a prefix and returns the node namespaceURI
corresponding to the prefix. Returnsnull
if theURI
does not exist. Passing innull
as theprefix
parameter will return the default namespace.Node.prototype.normalize()
: Organizes all text child nodes under this element, merges adjacent text nodes, and removes empty text nodes.Node.prototype.removeChild()
: Removes a child node of the current node. This child node must exist under the current node.Node.prototype.replaceChild()
: Replaces one child nodeNode
with another node for the selected node.
https://github.com/WindrunnerMax/EveryDay
https://developer.mozilla.org/en/docs/Web/API/Node