Package com.vaadin.client.flow.dom
Interface DomElement
- All Superinterfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionelemental.html.HTMLCollectionReturns thechildrenproperty containing all child elements of the element, as a live collection.Returns theclassListproperty.elemental.dom.ElementReturns thefirstElementChildproperty.Returns theinnerHTMLproperty.elemental.dom.ElementReturns 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 Details
-
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
Returns theinnerHTMLproperty.- Returns:
- the inner html
-
setInnerHTML
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
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
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
Sets an attribute value for this node.- Parameters:
name- the attribute namevalue- the attribute value
-
removeAttribute
Removes an attribute from this node.- Parameters:
name- the attribute name
-