Interface Element

All Superinterfaces:
EventTarget, InnerHTML, Node, NonDocumentTypeChildNode, ParentNode
All Known Subinterfaces:
HTMLAnchorElement, HTMLAppletElement, HTMLAreaElement, HTMLBaseElement, HTMLBaseFontElement, HTMLBodyElement, HTMLBRElement, HTMLButtonElement, HTMLCanvasElement, HTMLDataElement, HTMLDataListElement, HTMLDetailsElement, HTMLDialogElement, HTMLDirectoryElement, HTMLDivElement, HTMLDListElement, HTMLElement, HTMLEmbedElement, HTMLFieldSetElement, HTMLFontElement, HTMLFormElement, HTMLHeadElement, HTMLHeadingElement, HTMLHRElement, HTMLHtmlElement, HTMLIFrameElement, HTMLImageElement, HTMLInputElement, HTMLLabelElement, HTMLLegendElement, HTMLLIElement, HTMLLinkElement, HTMLMapElement, HTMLMarqueeElement, HTMLMenuElement, HTMLMetaElement, HTMLMeterElement, HTMLModElement, HTMLObjectElement, HTMLOListElement, HTMLOptGroupElement, HTMLOptionElement, HTMLOutputElement, HTMLParagraphElement, HTMLParamElement, HTMLPictureElement, HTMLPreElement, HTMLProgressElement, HTMLQuoteElement, HTMLScriptElement, HTMLSelectElement, HTMLSlotElement, HTMLSourceElement, HTMLSpanElement, HTMLStyleElement, HTMLTableCaptionElement, HTMLTableCellElement, HTMLTableColElement, HTMLTableDataCellElement, HTMLTableElement, HTMLTableHeaderCellElement, HTMLTableRowElement, HTMLTableSectionElement, HTMLTextAreaElement, HTMLTimeElement, HTMLTitleElement, HTMLUListElement, HTMLUnknownElement, HTMLVideoElement, SMILAnimateColorElement, SMILAnimateElement, SMILAnimateMotionElement, SMILAnimation, SMILElement, SMILLayoutElement, SMILMediaElement, SMILRefElement, SMILRegionElement, SMILRootLayoutElement, SMILSetElement, SMILSwitchElement, SMILTopLayoutElement, SVGAElement, SVGAltGlyphDefElement, SVGAltGlyphElement, SVGAltGlyphItemElement, SVGAnimateElement, SVGAnimateMotionElement, SVGAnimateTransformElement, SVGAnimationElement, SVGCircleElement, SVGClipPathElement, SVGColorProfileElement, SVGComponentTransferFunctionElement, SVGCursorElement, SVGDefinitionSrcElement, SVGDefsElement, SVGDescElement, SVGElement, SVGEllipseElement, SVGFEBlendElement, SVGFEColorMatrixElement, SVGFEComponentTransferElement, SVGFECompositeElement, SVGFEConvolveMatrixElement, SVGFEDiffuseLightingElement, SVGFEDisplacementMapElement, SVGFEDistantLightElement, SVGFEFloodElement, SVGFEFuncAElement, SVGFEFuncBElement, SVGFEFuncGElement, SVGFEFuncRElement, SVGFEGaussianBlurElement, SVGFEImageElement, SVGFEMergeElement, SVGFEMergeNodeElement, SVGFEMorphologyElement, SVGFEOffsetElement, SVGFEPointLightElement, SVGFESpecularLightingElement, SVGFESpotLightElement, SVGFETileElement, SVGFETurbulenceElement, SVGFilterElement, SVGFontElement, SVGFontFaceElement, SVGFontFaceFormatElement, SVGFontFaceNameElement, SVGFontFaceSrcElement, SVGFontFaceUriElement, SVGForeignObjectElement, SVGGElement, SVGGlyphElement, SVGGlyphRefElement, SVGGradientElement, SVGHKernElement, SVGImageElement, SVGLinearGradientElement, SVGLineElement, SVGMarkerElement, SVGMaskElement, SVGMetadataElement, SVGMissingGlyphElement, SVGMPathElement, SVGPathElement, SVGPatternElement, SVGPolygonElement, SVGPolylineElement, SVGRadialGradientElement, SVGRectElement, SVGScriptElement, SVGSetElement, SVGStopElement, SVGSVGElement, SVGSwitchElement, SVGSymbolElement, SVGTextContentElement, SVGTextElement, SVGTextPathElement, SVGTextPositioningElement, SVGTitleElement, SVGTRefElement, SVGTSpanElement, SVGUseElement, SVGViewElement, SVGVKernElement
All Known Implementing Classes:
DTMNodeProxy, ElementImpl, HTMLAnchorElementImpl, HTMLBaseElementImpl, HTMLBasicInputElement, HTMLBodyElementImpl, HTMLBRElementImpl, HTMLButtonElementImpl, HTMLCanvasElementImpl, HTMLCenterElementImpl, HTMLDDElementImpl, HTMLDetailsElementImpl, HTMLDialogElementImpl, HTMLDirectoryElementImpl, HTMLDivElementImpl, HTMLDListElementImpl, HTMLElementImpl, HTMLEmElementImpl, HTMLFieldsetElementImpl, HTMLFigureElementImpl, HTMLFormElementImpl, HTMLGenericMarkupElement, HTMLHeadElementImpl, HTMLHeadingElementImpl, HTMLHRElementImpl, HTMLHtmlElementImpl, HTMLIFrameElementImpl, HTMLImageElementImpl, HTMLInputElementImpl, HTMLLabelElementImpl, HTMLLegendElementImpl, HTMLLIElementImpl, HTMLLinkElementImpl, HTMLMarqueeElementImpl, HTMLMeterElementImpl, HTMLMonospacedElementImpl, HTMLNonStandardElement, HTMLNoScriptElementImpl, HTMLObjectElementImpl, HTMLOListElementImpl, HTMLOptGroupElementImpl, HTMLOptionElementImpl, HTMLPElementImpl, HTMLPreElementImpl, HTMLProcessingInstruction, HTMLProgressElementImpl, HTMLQuoteElementImpl, HTMLScriptElementImpl, HTMLSelectElementImpl, HTMLSmallElementImpl, HTMLSpanElementImpl, HTMLStrikeElementImpl, HTMLStrongElementImpl, HTMLStyleElementImpl, HTMLSuperscriptElementImpl, HTMLTableCaptionElementImpl, HTMLTableCellElementImpl, HTMLTableColElementImpl, HTMLTableColGroupElementImpl, HTMLTableElementImpl, HTMLTableRowElementImpl, HTMLTableSectionElementImpl, HTMLTextAreaElementImpl, HTMLTitleElementImpl, HTMLUListElementImpl, HTMLUnderlineElementImpl, HTMLVideoElementImpl, RSSChanelElementImpl, RSSDescriptionElementImpl, RSSElement, RSSElementImpl, RSSItemElementImpl, RSSTitleElementImpl, SVGAElementImpl, SVGAnimateElementImpl, SVGAnimateTransformElementImpl, SVGAnimationElementImpl, SVGAnimationImpl, SVGCircleElementImpl, SVGClipPathElementImpl, SVGDefsElementImpl, SVGElementImpl, SVGEllipseElementImpl, SVGFontElementImpl, SVGFontFaceElementImpl, SVGGElementImpl, SVGGradientElementImpl, SVGGraphic, SVGImageElementImpl, SVGLinearGradientElementImpl, SVGLineElementImpl, SVGLocatableImpl, SVGPathElementImpl, SVGPolygonElementImpl, SVGPolylineElementImpl, SVGRadialGradientElementImpl, SVGRectElementImpl, SVGStopElementImpl, SVGStylableImpl, SVGSVGElementImpl, SVGSymbolElementImpl, SVGTextElementImpl, SVGTransformableImpl, SVGUseElementImpl

public interface Element extends Node, InnerHTML, NonDocumentTypeChildNode, ParentNode
Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element.
  • Method Details

    • getClassList

      DOMTokenList getClassList()
      Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.
      Returns:
      a DOMTokenList object.
    • getClassName

      String getClassName()
      Returns the value of element's class content attribute. Can be set to change it.
      Returns:
      a String object.
    • setClassName

      void setClassName(String className)

      setClassName.

      Parameters:
      className - a String object.
    • getClientHeight

      int getClientHeight()

      getClientHeight.

      Returns:
      a Integer object.
    • getClientLeft

      int getClientLeft()

      getClientLeft.

      Returns:
      a Integer object.
    • getClientTop

      int getClientTop()

      getClientTop.

      Returns:
      a Integer object.
    • getClientWidth

      Integer getClientWidth()

      getClientWidth.

      Returns:
      a Integer object.
    • getId

      String getId()
      Returns the value of element's id content attribute. Can be set to change it.
      Returns:
      a String object.
    • setId

      void setId(String id)

      setId.

      Parameters:
      id - a String object.
    • getLocalName

      String getLocalName()
      Returns the local name.
      Specified by:
      getLocalName in interface Node
      Returns:
      a String object.
    • getNamespaceURI

      String getNamespaceURI()
      Returns the namespace.
      Specified by:
      getNamespaceURI in interface Node
      Returns:
      a String object.
    • getOuterHTML

      String getOuterHTML()

      getOuterHTML.

      Returns:
      a String object.
    • getInnerHTML

      String getInnerHTML()

      getInnerHTML.

      Specified by:
      getInnerHTML in interface InnerHTML
      Returns:
      a String object.
    • getInnerText

      String getInnerText()

      getInnerText.

      Returns:
      a String object.
    • getBoundingClientRect

      DOMRect getBoundingClientRect()

      getBoundingClientRect.

      Returns:
      a DOMRect object.
    • getClientRects

      DOMRectList getClientRects()

      getClientRects.

      Returns:
      a DOMRectList object.
    • getSchemaTypeInfo

      TypeInfo getSchemaTypeInfo()

      getSchemaTypeInfo.

      Returns:
      a TypeInfo object.
    • setOuterHTML

      void setOuterHTML(String outerHTML)

      setOuterHTML.

      Parameters:
      outerHTML - a String object.
    • getPrefix

      String getPrefix()
      Returns the namespace prefix.
      Specified by:
      getPrefix in interface Node
      Returns:
      a String object.
    • getScrollHeight

      double getScrollHeight()

      getScrollHeight.

      Returns:
      a double.
    • getScrollLeft

      double getScrollLeft()

      getScrollLeft.

      Returns:
      a double.
    • setScrollLeft

      void setScrollLeft(double scrollLeft)

      setScrollLeft.

      Parameters:
      scrollLeft - a Integer object.
    • getScrollTop

      double getScrollTop()

      getScrollTop.

      Returns:
      a double.
    • setScrollTop

      void setScrollTop(double scrollTop)

      setScrollTop.

      Parameters:
      scrollTop - a Integer object.
    • getScrollWidth

      double getScrollWidth()

      getScrollWidth.

      Returns:
      a double.
    • getSlot

      String getSlot()
      Returns the value of element's slot content attribute. Can be set to change it.
      Returns:
      a String object.
    • setSlot

      void setSlot(String slot)

      setSlot.

      Parameters:
      slot - a String object.
    • getTagName

      String getTagName()
      Returns the HTML-uppercased qualified name.
      Returns:
      a String object.
    • closest

      <E extends Element> E closest(String selector)
      Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.
      Type Parameters:
      E - a E object.
      Parameters:
      selector - a String object.
      Returns:
      a E object.
    • getAttribute

      String getAttribute(String qualifiedName)
      Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.
      Parameters:
      qualifiedName - a String object.
      Returns:
      a String object.
    • getAttributeNS

      String getAttributeNS(String namespace, String localName)
      Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.
      Parameters:
      namespace - a String object.
      localName - a String object.
      Returns:
      a String object.
    • getAttributeNames

      String[] getAttributeNames()
      Returns the qualified names of all element's attributes. Can contain duplicates.
      Returns:
      an array of String objects.
    • getAttributeNode

      Attr getAttributeNode(String name)

      getAttributeNode.

      Parameters:
      name - a String object.
      Returns:
      a Attr object.
    • getAttributeNodeNS

      Attr getAttributeNodeNS(String namespaceURI, String localName)

      getAttributeNodeNS.

      Parameters:
      namespaceURI - a String object.
      localName - a String object.
      Returns:
      a Attr object.
    • getElementsByClassName

      HTMLCollection getElementsByClassName(String classNames)
      Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
      Parameters:
      classNames - a String object.
      Returns:
      a HTMLCollection object.
    • getElementsByTagName

      HTMLCollection getElementsByTagName(String qualifiedName)

      getElementsByTagName.

      Parameters:
      qualifiedName - a String object.
      Returns:
      a HTMLCollection object.
    • getElementsByTagNameNS

      HTMLCollection getElementsByTagNameNS(String namespaceURI, String localName)

      getElementsByTagNameNS.

      Parameters:
      namespaceURI - a String object.
      localName - a String object.
      Returns:
      a HTMLCollection object.
    • hasAttribute

      boolean hasAttribute(String qualifiedName)
      Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.
      Parameters:
      qualifiedName - a String object.
      Returns:
      a boolean.
    • hasAttributeNS

      boolean hasAttributeNS(String namespace, String localName)
      Returns true if element has an attribute whose namespace is namespace and local name is localName.
      Parameters:
      namespace - a String object.
      localName - a String object.
      Returns:
      a boolean.
    • hasPointerCapture

      boolean hasPointerCapture(int pointerId)

      hasPointerCapture.

      Parameters:
      pointerId - a Integer object.
      Returns:
      a boolean.
    • matches

      boolean matches(String selectors)
      Returns true if matching selectors against element's root yields element, and false otherwise.
      Parameters:
      selectors - a String object.
      Returns:
      a boolean.
    • releasePointerCapture

      void releasePointerCapture(int pointerId)

      releasePointerCapture.

      Parameters:
      pointerId - a Integer object.
    • removeAttribute

      void removeAttribute(String qualifiedName)
      Removes element's first attribute whose qualified name is qualifiedName.
      Parameters:
      qualifiedName - a String object.
    • removeAttributeNS

      void removeAttributeNS(String namespace, String localName)
      Removes element's attribute whose namespace is namespace and local name is localName.
      Parameters:
      namespace - a String object.
      localName - a String object.
    • removeAttributeNode

      Attr removeAttributeNode(Attr attr)

      removeAttributeNode.

      Parameters:
      attr - a Attr object.
      Returns:
      a Attr object.
    • requestPointerLock

      void requestPointerLock()

      requestPointerLock.

    • scroll

      void scroll(int x, int y)

      scroll.

      Parameters:
      x - a double.
      y - a double.
    • scrollBy

      void scrollBy(int x, int y)

      scrollBy.

      Parameters:
      x - a double.
      y - a double.
    • scrollIntoView

      void scrollIntoView(boolean arg)

      scrollIntoView.

      Parameters:
      arg - a boolean.
    • scrollIntoView

      void scrollIntoView()

      scrollIntoView.

    • scrollTo

      void scrollTo(int x, int y)

      scrollTo.

      Parameters:
      x - a double.
      y - a double.
    • setAttribute

      void setAttribute(String qualifiedName, String value)
      Sets the value of element's first attribute whose qualified name is qualifiedName to value.
      Parameters:
      qualifiedName - a String object.
      value - a String object.
    • setAttributeNS

      void setAttributeNS(String namespace, String qualifiedName, String value)
      Sets the value of element's attribute whose namespace is namespace and local name is localName to value.
      Parameters:
      namespace - a String object.
      qualifiedName - a String object.
      value - a String object.
    • setAttributeNode

      Attr setAttributeNode(Attr attr)

      setAttributeNode.

      Parameters:
      attr - a Attr object.
      Returns:
      a Attr object.
    • setAttributeNodeNS

      Attr setAttributeNodeNS(Attr attr)

      setAttributeNodeNS.

      Parameters:
      attr - a Attr object.
      Returns:
      a Attr object.
    • setIdAttribute

      void setIdAttribute(String name, boolean isId)

      setIdAttribute.

      Parameters:
      name - a String object.
      isId - a boolean.
    • setIdAttributeNode

      void setIdAttributeNode(Attr idAttr, boolean isId)

      setIdAttributeNode.

      Parameters:
      idAttr - a Attr object.
      isId - a boolean.
    • setIdAttributeNS

      void setIdAttributeNS(String namespaceURI, String localName, boolean isId)

      setIdAttributeNode.

      Parameters:
      namespaceURI - a String object.
      localName - a String object.
      isId - a boolean.
    • setPointerCapture

      void setPointerCapture(int pointerId)

      setPointerCapture.

      Parameters:
      pointerId - a Integer object.
    • toggleAttribute

      boolean toggleAttribute(String qualifiedName, boolean force)
      If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.

      Returns true if qualifiedName is now present, and false otherwise.

      Parameters:
      qualifiedName - a String object.
      force - a boolean.
      Returns:
      a boolean.
    • toggleAttribute

      boolean toggleAttribute(String qualifiedName)

      toggleAttribute.

      Parameters:
      qualifiedName - a String object.
      Returns:
      a boolean.
    • insertAdjacentElement

      Node insertAdjacentElement(String where, Node insertedElement)

      insertAdjacentElement.

      Parameters:
      where - a String object.
      insertedElement - Node object.
      Returns:
      a Node object.
    • insertAdjacentHTML

      void insertAdjacentHTML(String position, String text)

      insertAdjacentHTML.

      Parameters:
      position - a String object.
      text - a String object.