Node
Extends: EventTarget
See: https://developer.mozilla.org/en-US/docs/Web/API/Node
- Node
- new Node(ownerDocument)
- instance
- .contentEditable
- .isConnected :
boolean
- .parentNode :
Node
- .parentElement :
Element
- .firstChild :
Node
- .lastChild :
Node
- .previousSibling :
Node
- .nextSibling :
Node
- .firstElementChild :
Node
- .lastElementChild :
Node
- .previousElementSibling :
Node
- .nextElementSibling :
Node
- .textContent :
string
- .childNodes :
NodeList
- .children :
HTMLCollection
- .ownerDocument
- .attributes
- .hasChildNodes()
- .cloneNode(deep)
- .appendChild(child)
- .insertBefore(child, before)
- .replaceChild(newChild, oldChild)
- .removeChild(child)
- .remove()
- .before(...nodes)
- .after(...nodes)
- .replaceWith(...nodes)
- .contains(node)
- .addEventListener(eventName, callback, [capture])
- .removeEventListener(eventName, callback, [capture])
- .dispatchEvent(event)
- static
new Node(ownerDocument)
Param | Type |
---|---|
ownerDocument | * |
node.contentEditable
Read only
node.isConnected : boolean
Read only
node.parentNode : Node
Read only
node.parentElement : Element
Read only
node.firstChild : Node
Read only
node.lastChild : Node
Read only
node.previousSibling : Node
Read only
node.nextSibling : Node
Read only
node.firstElementChild : Node
Read only
node.lastElementChild : Node
Read only
node.previousElementSibling : Node
Read only
node.nextElementSibling : Node
Read only
node.textContent : string
node.childNodes : NodeList
Read only
node.children : HTMLCollection
Read only
node.ownerDocument
Read only
node.attributes
Read only
node.hasChildNodes()
node.cloneNode(deep)
Param | Type |
---|---|
deep | boolean |
node.appendChild(child)
Param | Type |
---|---|
child | Node |
node.insertBefore(child, before)
Param | Type |
---|---|
child | Node |
before | Node |
node.replaceChild(newChild, oldChild)
Param | Type |
---|---|
newChild | Node |
oldChild | Node |
node.removeChild(child)
Param | Type |
---|---|
child | Node |
node.remove()
node.before(...nodes)
Param | Type |
---|---|
...nodes | Array.<Node> |
node.after(...nodes)
Param | Type |
---|---|
...nodes | Array.<Node> |
node.replaceWith(...nodes)
Param | Type |
---|---|
...nodes | Array.<Node> |
node.contains(node)
Param | Type |
---|---|
node | Node |
node.addEventListener(eventName, callback, [capture])
Param | Type | Default |
---|---|---|
eventName | * |
|
callback | * |
|
[capture] | boolean |
false |
node.removeEventListener(eventName, callback, [capture])
Param | Type | Default |
---|---|---|
eventName | * |
|
callback | * |
|
[capture] | boolean |
false |
node.dispatchEvent(event)
Param | Type |
---|---|
event | * |