public interface Node extends EventTarget
Modifier and Type | Method and Description |
---|---|
void |
appendChild(java.lang.Object child)
Insert a Node as the last child node of this element.
|
NodeList |
getChildNodes()
Getter for childNodes attribute
|
Node |
getFirstChild()
Getter for the firstChild attribute
|
java.lang.String |
getInnerText()
Getter for innerText property.
|
Node |
getLastChild()
Getter for the lastChild attribute
|
Element |
getParentElement()
Getter for the parentElement attribute
|
Node |
getParentNode()
Getter for the parentNode attribute
|
java.lang.String |
getTextContent()
Getter for textContent property.
Differences to innerText: Internet Explorer introduced element.innerText. |
boolean |
hasChildNodes()
Returns whether the element has any child nodes
|
Node |
insertBefore(Node newChild,
Node refChild)
Inserts the node newChild before the existing child node refChild.
|
void |
removeChild(java.lang.Object child)
Removes a child node from the current element, which must be a child of the current node.
|
Node |
replaceChild(Node newChild,
Node oldChild)
Replaces one child Node of the current one with the second one given in parameter.
|
void |
setInnerText(java.lang.String innerText)
Setter for innerText property.
It is a nonstandard property that represents the text content of a node and its descendants. |
void |
setTextContent(java.lang.String textContent) |
addEventListener, dispatchEvent, removeEventListener
NodeList getChildNodes()
Node getFirstChild()
Node getLastChild()
Node getParentNode()
Element getParentElement()
java.lang.String getTextContent()
getInnerText()
void setTextContent(java.lang.String textContent)
s
- The textContent property represents the text content of a node and its descendants.java.lang.String getInnerText()
It is a nonstandard property that represents the text content of a node and its descendants. As a getter, it approximates the text the user would get if they highlighted the contents of the element with the cursor and then copied to the clipboard.
getTextContent()
void setInnerText(java.lang.String innerText)
innerText
- The innerText value to setboolean hasChildNodes()
void appendChild(java.lang.Object child)
child
- The child to be insertedvoid removeChild(java.lang.Object child)
child
- The child to removeNode replaceChild(Node newChild, Node oldChild)
newChild
- The new node to replace oldChild. If it already exists in the ReactDOM, it is first removed.oldChild
- The existing child to be replaced.Node insertBefore(Node newChild, Node refChild)
newChild
- The node to insert.refChild
- The reference node, i.e., the node before which the new node must be inserted.