Package com.vaadin.client.flow.dom
Interface DomElement
-
- All Superinterfaces:
DomNode
@JsType(isNative=true) public interface DomElement extends DomNode
Element that has all methods from Element API that have been overridden in Polymer DOM module.No instances of this class should be created directly, but instead
DomApi.wrap(elemental.dom.Node)should be used- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceDomElement.DomTokenListA DOMTokenList java representation.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description elemental.html.HTMLCollectiongetChildren()Returns thechildrenproperty containing all child elements of the element, as a live collection.DomElement.DomTokenListgetClassList()Returns theclassListproperty.elemental.dom.ElementgetFirstElementChild()Returns thefirstElementChildproperty.StringgetInnerHTML()Returns theinnerHTMLproperty.elemental.dom.ElementgetLastElementChild()Returns thelastElementChildproperty.elemental.dom.ElementquerySelector(String selectors)Returns the firstNodewhich matches the specified selector string relative to the element.JsArray<elemental.dom.Node>querySelectorAll(String selectors)Returns a non-liveNodeListof all elements descended from this element and match the given group of CSS selectors.voidremoveAttribute(String name)Removes an attribute from this node.voidsetAttribute(String name, String value)Sets an attribute value for this node.voidsetInnerHTML(String innerHTML)Sets theinnerHTMLproperty to the given string.-
Methods inherited from interface com.vaadin.client.flow.dom.DomNode
appendChild, cloneNode, getChildNodes, getFirstChild, getLastChild, getNextSibling, getParentNode, getPreviousSibling, getTextContent, insertBefore, isSameNode, removeChild, replaceChild, setTextContent
-
-
-
-
Method Detail
-
getClassList
@JsProperty DomElement.DomTokenList getClassList()
Returns theclassListproperty.- Returns:
- the class list
-
getFirstElementChild
@JsProperty elemental.dom.Element getFirstElementChild()
Returns thefirstElementChildproperty.- Returns:
- the first element child
-
getLastElementChild
@JsProperty elemental.dom.Element getLastElementChild()
Returns thelastElementChildproperty.- Returns:
- the last last element child
-
getInnerHTML
@JsProperty String getInnerHTML()
Returns theinnerHTMLproperty.- Returns:
- the inner html
-
setInnerHTML
@JsProperty void setInnerHTML(String innerHTML)
Sets theinnerHTMLproperty to the given string.- Parameters:
innerHTML- the inner html to set
-
getChildren
@JsProperty elemental.html.HTMLCollection getChildren()
Returns thechildrenproperty containing all child elements of the element, as a live collection.- Returns:
- a collection of all child elements
-
querySelector
elemental.dom.Element querySelector(String selectors)
Returns the firstNodewhich matches the specified selector string relative to the element.- Parameters:
selectors- a group of selectors to match on- Returns:
- the first node that matched the given selectors
-
querySelectorAll
JsArray<elemental.dom.Node> querySelectorAll(String selectors)
Returns a non-liveNodeListof 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)andJsArray.length()methods can be used from the returned "array".- Parameters:
selectors- a group of selectors to match on- Returns:
- a non-live node list of elements that matched the given selectors
-
setAttribute
void setAttribute(String name, String value)
Sets an attribute value for this node.- Parameters:
name- the attribute namevalue- the attribute value
-
removeAttribute
void removeAttribute(String name)
Removes an attribute from this node.- Parameters:
name- the attribute name
-
-