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
  • Method Details

    • getClassList

      @JsProperty DomElement.DomTokenList getClassList()
      Returns the classList property.
      Returns:
      the class list
    • getFirstElementChild

      @JsProperty elemental.dom.Element getFirstElementChild()
      Returns the firstElementChild property.
      Returns:
      the first element child
    • getLastElementChild

      @JsProperty elemental.dom.Element getLastElementChild()
      Returns the lastElementChild property.
      Returns:
      the last last element child
    • getInnerHTML

      @JsProperty String getInnerHTML()
      Returns the innerHTML property.
      Returns:
      the inner html
    • setInnerHTML

      @JsProperty void setInnerHTML(String innerHTML)
      Sets the innerHTML property to the given string.
      Parameters:
      innerHTML - the inner html to set
    • getChildren

      @JsProperty elemental.html.HTMLCollection getChildren()
      Returns the children property 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 first Node which 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-live 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".

      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 name
      value - the attribute value
    • removeAttribute

      void removeAttribute(String name)
      Removes an attribute from this node.
      Parameters:
      name - the attribute name