@JsType(isNative=true)
public interface DomNode
No instances of this class should be created directly, but instead
DomApi.wrap(elemental.dom.Node) should be used
| Modifier and Type | Method and Description |
|---|---|
void |
appendChild(elemental.dom.Node node)
Insert a node as the last child node of this element.
|
elemental.dom.Node |
cloneNode(boolean deep)
Clone a Node, and optionally, all of its contents.
|
JsArray<elemental.dom.Node> |
getChildNodes()
Returns the
childNodes property. |
elemental.dom.Node |
getFirstChild()
Returns the
firstChild property. |
elemental.dom.Node |
getLastChild()
Returns the
lastChild property. |
elemental.dom.Node |
getNextSibling()
Returns the
nextSibling property. |
elemental.dom.Node |
getParentNode()
Gets the parent node of this node.
|
elemental.dom.Node |
getPreviousSibling()
Returns the
previousSibling property. |
String |
getTextContent()
Returns the
textContent property. |
void |
insertBefore(elemental.dom.Node newChild,
elemental.dom.Node refChild)
Inserts the first Node given in a parameter immediately before the
second, child of this element, Node.
|
boolean |
isSameNode(elemental.dom.Node node)
The isSameNode() method for Node objects is a legacy alias the for the
=== strict equality operator.
|
void |
removeChild(elemental.dom.Node childNode)
Removes a child node from the current node, which much be a child of the
current node.
|
void |
replaceChild(elemental.dom.Node newChild,
elemental.dom.Node oldChild)
Replaces one child Node of the current one with the second one given in
parameter.
|
void |
setTextContent(String textContent)
A setter for the
childNodes property. |
@JsProperty JsArray<elemental.dom.Node> getChildNodes()
childNodes property.
NOTE: returns an array since that is what the Polymer.dom API does, and
luckily native NodeList items can be accessed array like with
list[index].
This means that only JsArray.get(int) and
JsArray.length() methods can be used from the returned "array".
@JsProperty elemental.dom.Node getFirstChild()
firstChild property.@JsProperty elemental.dom.Node getLastChild()
lastChild property.@JsProperty elemental.dom.Node getNextSibling()
nextSibling property.@JsProperty elemental.dom.Node getPreviousSibling()
previousSibling property.@JsProperty String getTextContent()
textContent property.@JsProperty void setTextContent(String textContent)
childNodes property.textContent - the text content to setvoid appendChild(elemental.dom.Node node)
node - the node to appendvoid insertBefore(elemental.dom.Node newChild,
elemental.dom.Node refChild)
newChild - the node to be insertedrefChild - the node before which newChild is insertedvoid removeChild(elemental.dom.Node childNode)
childNode - the child node to removevoid replaceChild(elemental.dom.Node newChild,
elemental.dom.Node oldChild)
newChild - the new node to replace the oldChild. If it already exists in
the DOM, it is first removed.oldChild - is the existing child to be replaced.elemental.dom.Node cloneNode(boolean deep)
deep - true if the children of the node should also be
cloned, or false to clone only the specified
node.@JsProperty elemental.dom.Node getParentNode()
null if this node has no
parent.boolean isSameNode(elemental.dom.Node node)
node - the node to testCopyright © 2000–2026 Vaadin Ltd. All rights reserved.