@JsType(isNative=true) public interface DomElement extends DomNode
No instances of this class should be created directly, but instead
DomApi.wrap(elemental.dom.Node) should be used
| Modifier and Type | Interface and Description |
|---|---|
static interface |
DomElement.DomTokenList
A
DOMTokenList java representation.
|
| Modifier and Type | Method and Description |
|---|---|
elemental.html.HTMLCollection |
getChildren()
Returns the
children property containing all child elements
of the element, as a live collection. |
DomElement.DomTokenList |
getClassList()
Returns the
classList property. |
elemental.dom.Element |
getFirstElementChild()
Returns the
firstElementChild property. |
String |
getInnerHTML()
Returns the
innerHTML property. |
elemental.dom.Element |
getLastElementChild()
Returns the
lastElementChild property. |
elemental.dom.Element |
querySelector(String selectors)
Returns the first
Node which matches the specified selector
string relative to the element. |
JsArray<elemental.dom.Node> |
querySelectorAll(String selectors)
Returns a non-live
NodeList of all elements descended from
this element and match the given group of CSS selectors. |
void |
removeAttribute(String name)
Removes an attribute from this node.
|
void |
setAttribute(String name,
String value)
Sets an attribute value for this node.
|
void |
setInnerHTML(String innerHTML)
Sets the
innerHTML property to the given string. |
appendChild, cloneNode, getChildNodes, getFirstChild, getLastChild, getNextSibling, getParentNode, getPreviousSibling, getTextContent, insertBefore, removeChild, replaceChild, setTextContent@JsProperty DomElement.DomTokenList getClassList()
classList property.@JsProperty elemental.dom.Element getFirstElementChild()
firstElementChild property.@JsProperty elemental.dom.Element getLastElementChild()
lastElementChild property.@JsProperty String getInnerHTML()
innerHTML property.@JsProperty void setInnerHTML(String innerHTML)
innerHTML property to the given string.innerHTML - the inner html to set@JsProperty elemental.html.HTMLCollection getChildren()
children property containing all child elements
of the element, as a live collection.elemental.dom.Element querySelector(String selectors)
Node which matches the specified selector
string relative to the element.selectors - a group of selectors to match onJsArray<elemental.dom.Node> querySelectorAll(String selectors)
NodeList of all elements descended from
this element and match the given group of CSS selectors.
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".
selectors - a group of selectors to match onvoid setAttribute(String name, String value)
name - the attribute namevalue - the attribute valuevoid removeAttribute(String name)
name - the attribute nameCopyright © 2000–2020 Vaadin Ltd. All rights reserved.