Package org.htmlunit.html

# Class DomElement

java.lang.Object
org.htmlunit.html.DomNode
org.htmlunit.html.DomNamespaceNode
org.htmlunit.html.DomElement

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `Element`, `Node`

Direct Known Subclasses:
  `HtmlElement`

public class DomElement extends DomNamespaceNode implements Element

See Also:
  - Serialized Form

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `protected static class`
  `DomElement.ChildElementsIterator`
  An iterator over the DomElement children.

  ## Nested classes/interfaces inherited from class org.htmlunit.html.DomNode

  `DomNode.ChildIterator, DomNode.DescendantDomElementsIterator, DomNode.DescendantDomNodesIterator, DomNode.DescendantElementsIterator<T extends DomNode>, DomNode.DescendantHtmlElementsIterator`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `ATTRIBUTE_NOT_DEFINED`
  Constant meaning that the specified attribute was not defined.
  `static final String`
  `ATTRIBUTE_VALUE_EMPTY`
  Constant meaning that the specified attribute was found but its value was empty.
  `static final String`
  `ID_ATTRIBUTE`
  id.
  `static final String`
  `NAME_ATTRIBUTE`
  name.
  `static final String`
  `SRC_ATTRIBUTE`
  src.
  `static final String`
  `TYPE_ATTRIBUTE`
  type.
  `static final String`
  `VALUE_ATTRIBUTE`
  value.

  ### Fields inherited from class org.htmlunit.html.DomNode

  `PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED`

  ### Fields inherited from interface org.w3c.dom.Node

  `ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DomElement(String namespaceURI, String qualifiedName, SgmlPage page, Map<String,DomAttr> attributes)`
  Creates an instance of a DOM element that can have a namespace.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `blur()`
  Removes focus from this element.
  `<P extends Page>
  P`
  `click()`
  Simulates clicking on this element, returning the page in the window that has the focus after the element has been clicked.
  `<P extends Page>
  P`
  `click(boolean shiftKey, boolean ctrlKey, boolean altKey)`
  Simulates clicking on this element, returning the page in the window that has the focus after the element has been clicked.
  `<P extends Page>
  P`
  `click(boolean shiftKey, boolean ctrlKey, boolean altKey, boolean triggerMouseEvents)`
  Simulates clicking on this element, returning the page in the window that has the focus after the element has been clicked.
  `<P extends Page>
  P`
  `click(boolean shiftKey, boolean ctrlKey, boolean altKey, boolean triggerMouseEvents, boolean handleFocus, boolean ignoreVisibility, boolean disableProcessLabelAfterBubbling)`
  INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
  Simulates clicking on this element, returning the page in the window that has the focus after the element has been clicked.
  `<P extends Page>
  P`
  `click(org.htmlunit.javascript.host.event.Event event, boolean shiftKey, boolean ctrlKey, boolean altKey, boolean ignoreVisibility)`
  INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
  Simulates clicking on this element, returning the page in the window that has the focus after the element has been clicked.
  `DomNode`
  `cloneNode(boolean deep)`
  `<P extends Page>
  P`
  `dblClick()`
  Simulates double-clicking on this element, returning the page in the window that has the focus after the element has been clicked.
  `<P extends Page>
  P`
  `dblClick(boolean shiftKey, boolean ctrlKey, boolean altKey)`
  Simulates double-clicking on this element, returning the page in the window that has the focus after the element has been clicked.
  `protected void`
  `doClickFireChangeEvent()`
  This method implements the control onchange handler call during the click action.
  `protected ScriptResult`
  `doClickFireClickEvent(org.htmlunit.javascript.host.event.Event event)`
  This method implements the control onclick handler call during the click action.
  `protected boolean`
  `doClickStateUpdate(boolean shiftKey, boolean ctrlKey)`
  This method implements the control state update part of the click action.
  `ScriptResult`
  `fireEvent(String eventType)`
  INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
  Shortcut for `fireEvent(Event)`.
  `ScriptResult`
  `fireEvent(org.htmlunit.javascript.host.event.Event event)`
  INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
  Fires the event on the element.
  `void`
  `focus()`
  Sets the focus on this element.
  `String`
  `getAttribute(String attributeName)`
  Returns the value of the attribute specified by name or an empty string.
  `String`
  `getAttributeDirect(String attributeName)`
  INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
  `DomAttr`
  `getAttributeNode(String name)`
  `DomAttr`
  `getAttributeNodeNS(String namespaceURI, String localName)`
  `final String`
  `getAttributeNS(String namespaceURI, String localName)`
  Returns the value of the attribute specified by namespace and local name or an empty string.
  `NamedNodeMap`
  `getAttributes()`
  `final Map<String,DomAttr>`
  `getAttributesMap()`
  Returns the map holding the attributes, keyed by name.
  `int`
  `getChildElementCount()`
  Returns the current number of element nodes that are children of this element.
  `final Iterable<DomElement>`
  `getChildElements()`
  `DomNodeList<HtmlElement>`
  `getElementsByTagName(String tagName)`
  `DomNodeList<HtmlElement>`
  `getElementsByTagNameNS(String namespace, String localName)`
  Not yet implemented.
  `protected DomNode`
  `getEventTargetElement()`
  Returns the event target element.
  `DomElement`
  `getFirstElementChild()`
  Returns the first child element node of this element. null if this element has no child elements.
  `final String`
  `getId()`
  `DomElement`
  `getLastElementChild()`
  Returns the last child element node of this element. null if this element has no child elements.
  `String`
  `getNodeName()`
  `final short`
  `getNodeType()`
  `TypeInfo`
  `getSchemaTypeInfo()`
  Not yet implemented.
  `<E extends HtmlElement>
  List<E>`
  `getStaticElementsByTagName(String tagName)`
  INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
  `org.htmlunit.css.StyleElement`
  `getStyleElement(String name)`
  INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
  Determines the StyleElement for the given name.
  `org.htmlunit.css.StyleElement`
  `getStyleElementCaseInSensitive(String name)`
  INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
  Determines the StyleElement for the given name.
  `LinkedHashMap<String,org.htmlunit.css.StyleElement>`
  `getStyleMap()`
  INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
  Returns a sorted map containing style elements, keyed on style element name.
  `final String`
  `getTagName()`
  Returns the tag name of this element.
  `boolean`
  `hasAttribute(String attributeName)`
  Returns whether the attribute specified by name has a value.
  `final boolean`
  `hasAttributeNS(String namespaceURI, String localName)`
  Returns whether the attribute specified by namespace and local name has a value.
  `final boolean`
  `hasAttributes()`
  `protected boolean`
  `isAttributeCaseSensitive()`
  Indicates if the attribute names are case sensitive.
  `protected boolean`
  `isDisabledElementAndDisabled()`
  `protected boolean`
  `isEmptyXmlTagExpanded()`
  Indicates if a node without children should be written in expanded form as XML (i.e. with closing tag rather than with "/>")
  `boolean`
  `isMouseOver()`
  Returns whether the Mouse is currently over this element or not.
  `protected boolean`
  `isStateUpdateFirst()`
  Returns `true` if state updates should be done before onclick event handling.
  `boolean`
  `matches(String selectorString)`
  Returns true if the element would be selected by the specified selector string; otherwise, returns false.
  `Page`
  `mouseDown()`
  Simulates clicking the mouse on this element, returning the page which this element's window contains after the mouse click.
  `Page`
  `mouseDown(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)`
  Simulates clicking the mouse on this element, returning the page which this element's window contains after the mouse click.
  `Page`
  `mouseMove()`
  Simulates moving the mouse over this element, returning the page which this element's window contains after the mouse move.
  `Page`
  `mouseMove(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)`
  Simulates moving the mouse over this element, returning the page which this element's window contains after the mouse move.
  `Page`
  `mouseOut()`
  Simulates moving the mouse out of this element, returning the page which this element's window contains after the mouse move.
  `Page`
  `mouseOut(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)`
  Simulates moving the mouse out of this element, returning the page which this element's window contains after the mouse move.
  `Page`
  `mouseOver()`
  Simulates moving the mouse over this element, returning the page which this element's window contains after the mouse move.
  `Page`
  `mouseOver(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)`
  Simulates moving the mouse over this element, returning the page which this element's window contains after the mouse move.
  `Page`
  `mouseUp()`
  Simulates releasing the mouse click on this element, returning the page which this element's window contains after the mouse click release.
  `Page`
  `mouseUp(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)`
  Simulates releasing the mouse click on this element, returning the page which this element's window contains after the mouse click release.
  `protected void`
  `preventDefault()`
  This method is called if the current fired event is canceled by `preventDefault()`.
  `protected void`
  `printOpeningTagContentAsXml(PrintWriter printWriter)`
  Prints the content between "<" and ">" (or "/>") in the output of the tag name and its attributes in XML format.
  `protected void`
  `printXml(String indent, PrintWriter printWriter)`
  Recursively write the XML data for the node tree starting at `node`.
  `protected boolean`
  `propagateClickStateUpdateToParent()`
  `void`
  `removeAttribute(String attributeName)`
  Removes an attribute specified by name from this element.
  `final Attr`
  `removeAttributeNode(Attr attribute)`
  Not yet implemented.
  `final void`
  `removeAttributeNS(String namespaceURI, String localName)`
  Removes an attribute specified by namespace and local name from this element.
  `void`
  `removeFocus()`
  INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
  Gets notified that it has lost the focus.
  `String`
  `removeStyleAttribute(String name)`
  INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
  Removes the specified style attribute, returning the value of the removed attribute.
  `void`
  `replaceStyleAttribute(String name, String value, String priority)`
  INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
  Replaces the value of the named style attribute.
  `Page`
  `rightClick()`
  Simulates right clicking the mouse on this element, returning the page which this element's window contains after the mouse click.
  `Page`
  `rightClick(boolean shiftKey, boolean ctrlKey, boolean altKey)`
  Simulates right clicking the mouse on this element, returning the page which this element's window contains after the mouse click.
  `void`
  `setAttribute(String attributeName, String attributeValue)`
  Sets the value of the attribute specified by name.
  `Attr`
  `setAttributeNode(Attr attribute)`
  `Attr`
  `setAttributeNodeNS(Attr attribute)`
  Not yet implemented.
  `void`
  `setAttributeNS(String namespaceURI, String qualifiedName, String attributeValue)`
  Sets the value of the attribute specified by namespace and qualified name.
  `protected void`
  `setAttributeNS(String namespaceURI, String qualifiedName, String attributeValue, boolean notifyAttributeChangeListeners, boolean notifyMutationObservers)`
  Sets the value of the attribute specified by namespace and qualified name.
  `void`
  `setDefaults(org.htmlunit.css.ComputedCssStyleDeclaration style)`
  Callback method which allows different HTML element types to perform custom initialization of computed styles.
  `final void`
  `setId(String newId)`
  Sets the identifier this element.
  `void`
  `setIdAttribute(String name, boolean isId)`
  Not yet implemented.
  `final void`
  `setIdAttributeNode(Attr idAttr, boolean isId)`
  Not yet implemented.
  `void`
  `setIdAttributeNS(String namespaceURI, String localName, boolean isId)`
  Not yet implemented.
  `void`
  `setInnerHtml(String source)`
  Replaces all child elements of this element with the supplied value parsed as html.
  `void`
  `setNodeValue(String value)`
  `String`
  `toString()`
  Returns a string representation of this element.
  `void`
  `writeStyleToElement(Map<String,org.htmlunit.css.StyleElement> styleMap)`
  INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.

  ### Methods inherited from class org.htmlunit.html.DomNamespaceNode

  `getLocalName, getLowercaseName, getNamespaceURI, getPrefix, getQualifiedName, processImportNode, setPrefix`

  ### Methods inherited from class org.htmlunit.html.DomNode

  `addCharacterDataChangeListener, addDomChangeListener, appendChild, asNormalizedText, asXml, basicRemove, checkChildHierarchy, closest, compareDocumentPosition, detach, fireCharacterDataChanged, fireNodeAdded, fireNodeDeleted, getAncestors, getBaseURI, getByXPath, getByXPath, getCanonicalXPath, getChildNodes, getChildren, getDescendants, getDomElementDescendants, getEndColumnNumber, getEndLineNumber, getFeature, getFirstByXPath, getFirstByXPath, getFirstChild, getHtmlElementDescendants, getHtmlPageOrNull, getIndex, getLastChild, getNextElementSibling, getNextSibling, getNodeValue, getOwnerDocument, getPage, getParentNode, getPreviousElementSibling, getPreviousSibling, getReadyState, getScriptableObject, getSelectorList, getStartColumnNumber, getStartLineNumber, getTextContent, getUserData, getVisibleText, handles, hasChildNodes, hasFeature, insertBefore, insertBefore, isAncestorOf, isAncestorOfAny, isAttachedToPage, isDefaultNamespace, isDisplayed, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, mayBeDisplayed, normalize, notifyIncorrectness, onAddedToDocumentFragment, onAddedToPage, onAllChildrenAddedToPage, parseHtmlSnippet, printChildrenAsXml, querySelector, querySelectorAll, quietlyRemoveAndMoveChildrenTo, remove, removeAllChildren, removeCharacterDataChangeListener, removeChild, removeDomChangeListener, replace, replaceChild, setEndLocation, setParentNode, setReadyState, setScriptableObject, setStartLocation, setTextContent, setUserData`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface org.w3c.dom.Node

  `appendChild, compareDocumentPosition, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setPrefix, setTextContent, setUserData`

- ## Field Details

  - ### ID_ATTRIBUTE

    public static final String ID_ATTRIBUTE
    id.
    See Also:
      - Constant Field Values

  - ### NAME_ATTRIBUTE

    public static final String NAME_ATTRIBUTE
    name.
    See Also:
      - Constant Field Values

  - ### SRC_ATTRIBUTE

    public static final String SRC_ATTRIBUTE
    src.
    See Also:
      - Constant Field Values

  - ### VALUE_ATTRIBUTE

    public static final String VALUE_ATTRIBUTE
    value.
    See Also:
      - Constant Field Values

  - ### TYPE_ATTRIBUTE

    public static final String TYPE_ATTRIBUTE
    type.
    See Also:
      - Constant Field Values

  - ### ATTRIBUTE_NOT_DEFINED

    public static final String ATTRIBUTE_NOT_DEFINED
    Constant meaning that the specified attribute was not defined.

  - ### ATTRIBUTE_VALUE_EMPTY

    public static final String ATTRIBUTE_VALUE_EMPTY
    Constant meaning that the specified attribute was found but its value was empty.

- ## Constructor Details

  - ### DomElement

    public DomElement(String namespaceURI, String qualifiedName, SgmlPage page, Map<String,DomAttr> attributes)
    Creates an instance of a DOM element that can have a namespace.
    Parameters:
      `namespaceURI` - the URI that identifies an XML namespace
      `qualifiedName` - the qualified name of the element type to instantiate
      `page` - the page that contains this element
      `attributes` - a map ready initialized with the attributes for this element, or `null`. The map will be stored as is, not copied.

- ## Method Details

  - ### getNodeName

    public String getNodeName()
    Specified by:
      `getNodeName` in interface `Node`

  - ### getNodeType

    public final short getNodeType()
    Specified by:
      `getNodeType` in interface `Node`

  - ### getTagName

    public final String getTagName()
    Returns the tag name of this element.
    Specified by:
      `getTagName` in interface `Element`
    Returns:
      the tag name of this element

  - ### hasAttributes

    public final boolean hasAttributes()
    Specified by:
      `hasAttributes` in interface `Node`
    Overrides:
      `hasAttributes` in class `DomNode`

  - ### hasAttribute

    public boolean hasAttribute(String attributeName)
    Returns whether the attribute specified by name has a value.
    Specified by:
      `hasAttribute` in interface `Element`
    Parameters:
      `attributeName` - the name of the attribute
    Returns:
      true if an attribute with the given name is specified on this element or has a default value, false otherwise.

  - ### replaceStyleAttribute

    public void replaceStyleAttribute(String name, String value, String priority)
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Replaces the value of the named style attribute. If there is no style attribute with the specified name, a new one is added. If the specified value is an empty (or all whitespace) string, this method actually removes the named style attribute.
    Parameters:
      `name` - the attribute name (delimiter-separated, not camel-cased)
      `value` - the attribute value
      `priority` - the new priority of the property; `"important"`or the empty string if none.

  - ### removeStyleAttribute

    public String removeStyleAttribute(String name)
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Removes the specified style attribute, returning the value of the removed attribute.
    Parameters:
      `name` - the attribute name (delimiter-separated, not camel-cased)
    Returns:
      the removed value

  - ### getStyleElement

    public org.htmlunit.css.StyleElement getStyleElement(String name)
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Determines the StyleElement for the given name.
    Parameters:
      `name` - the name of the requested StyleElement
    Returns:
      the StyleElement or null if not found

  - ### getStyleElementCaseInSensitive

    public org.htmlunit.css.StyleElement getStyleElementCaseInSensitive(String name)
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Determines the StyleElement for the given name. This ignores the case of the name.
    Parameters:
      `name` - the name of the requested StyleElement
    Returns:
      the StyleElement or null if not found

  - ### getStyleMap

    public LinkedHashMap<String,org.htmlunit.css.StyleElement> getStyleMap()
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Returns a sorted map containing style elements, keyed on style element name. We use a `LinkedHashMap` map so that results are deterministic and are thus testable.
    Returns:
      a sorted map containing style elements, keyed on style element name

  - ### printOpeningTagContentAsXml

    protected void printOpeningTagContentAsXml(PrintWriter printWriter)
    Prints the content between "<" and ">" (or "/>") in the output of the tag name and its attributes in XML format.
    Parameters:
      `printWriter` - the writer to print in

  - ### printXml

    protected void printXml(String indent, PrintWriter printWriter)
    Recursively write the XML data for the node tree starting at `node`.
    Overrides:
      `printXml` in class `DomNode`
    Parameters:
      `indent` - white space to indent child nodes
      `printWriter` - writer where child nodes are written

  - ### isEmptyXmlTagExpanded

    protected boolean isEmptyXmlTagExpanded()
    Indicates if a node without children should be written in expanded form as XML (i.e. with closing tag rather than with "/>")
    Returns:
      `false` by default

  - ### getAttribute

    public String getAttribute(String attributeName)
    Returns the value of the attribute specified by name or an empty string. If the result is an empty string then it will be either `ATTRIBUTE_NOT_DEFINED` if the attribute wasn't specified or `ATTRIBUTE_VALUE_EMPTY` if the attribute was specified but it was empty.
    Specified by:
      `getAttribute` in interface `Element`
    Parameters:
      `attributeName` - the name of the attribute
    Returns:
      the value of the attribute or `ATTRIBUTE_NOT_DEFINED` or `ATTRIBUTE_VALUE_EMPTY`

  - ### getAttributeDirect

    public String getAttributeDirect(String attributeName)
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Parameters:
      `attributeName` - the name of the attribute
    Returns:
      the value of the attribute or `ATTRIBUTE_NOT_DEFINED` or `ATTRIBUTE_VALUE_EMPTY`

  - ### removeAttribute

    public void removeAttribute(String attributeName)
    Removes an attribute specified by name from this element.
    Specified by:
      `removeAttribute` in interface `Element`
    Parameters:
      `attributeName` - the attribute attributeName

  - ### removeAttributeNS

    public final void removeAttributeNS(String namespaceURI, String localName)
    Removes an attribute specified by namespace and local name from this element.
    Specified by:
      `removeAttributeNS` in interface `Element`
    Parameters:
      `namespaceURI` - the URI that identifies an XML namespace
      `localName` - the name within the namespace

  - ### removeAttributeNode

    public final Attr removeAttributeNode(Attr attribute)
    Not yet implemented.
    Specified by:
      `removeAttributeNode` in interface `Element`

  - ### hasAttributeNS

    public final boolean hasAttributeNS(String namespaceURI, String localName)
    Returns whether the attribute specified by namespace and local name has a value.
    Specified by:
      `hasAttributeNS` in interface `Element`
    Parameters:
      `namespaceURI` - the URI that identifies an XML namespace
      `localName` - the name within the namespace
    Returns:
      true if an attribute with the given name is specified on this element or has a default value, false otherwise.

  - ### getAttributesMap

    public final Map<String,DomAttr> getAttributesMap()
    Returns the map holding the attributes, keyed by name.
    Returns:
      the attributes map

  - ### getAttributes

    public NamedNodeMap getAttributes()
    Specified by:
      `getAttributes` in interface `Node`
    Overrides:
      `getAttributes` in class `DomNode`

  - ### setAttribute

    public void setAttribute(String attributeName, String attributeValue)
    Sets the value of the attribute specified by name.
    Specified by:
      `setAttribute` in interface `Element`
    Parameters:
      `attributeName` - the name of the attribute
      `attributeValue` - the value of the attribute

  - ### setAttributeNS

    public void setAttributeNS(String namespaceURI, String qualifiedName, String attributeValue)
    Sets the value of the attribute specified by namespace and qualified name.
    Specified by:
      `setAttributeNS` in interface `Element`
    Parameters:
      `namespaceURI` - the URI that identifies an XML namespace
      `qualifiedName` - the qualified name (prefix:local) of the attribute
      `attributeValue` - the value of the attribute

  - ### setAttributeNS

    protected void setAttributeNS(String namespaceURI, String qualifiedName, String attributeValue, boolean notifyAttributeChangeListeners, boolean notifyMutationObservers)
    Sets the value of the attribute specified by namespace and qualified name.
    Parameters:
      `namespaceURI` - the URI that identifies an XML namespace
      `qualifiedName` - the qualified name (prefix:local) of the attribute
      `attributeValue` - the value of the attribute
      `notifyAttributeChangeListeners` - to notify the associated `HtmlAttributeChangeListener`s
      `notifyMutationObservers` - to notify `MutationObserver`s or not

  - ### isAttributeCaseSensitive

    protected boolean isAttributeCaseSensitive()
    Indicates if the attribute names are case sensitive.
    Returns:
      `true`

  - ### getAttributeNS

    public final String getAttributeNS(String namespaceURI, String localName)
    Returns the value of the attribute specified by namespace and local name or an empty string. If the result is an empty string then it will be either `ATTRIBUTE_NOT_DEFINED` if the attribute wasn't specified or `ATTRIBUTE_VALUE_EMPTY` if the attribute was specified but it was empty.
    Specified by:
      `getAttributeNS` in interface `Element`
    Parameters:
      `namespaceURI` - the URI that identifies an XML namespace
      `localName` - the name within the namespace
    Returns:
      the value of the attribute or `ATTRIBUTE_NOT_DEFINED` or `ATTRIBUTE_VALUE_EMPTY`

  - ### getAttributeNode

    public DomAttr getAttributeNode(String name)
    Specified by:
      `getAttributeNode` in interface `Element`

  - ### getAttributeNodeNS

    public DomAttr getAttributeNodeNS(String namespaceURI, String localName)
    Specified by:
      `getAttributeNodeNS` in interface `Element`

  - ### writeStyleToElement

    public void writeStyleToElement(Map<String,org.htmlunit.css.StyleElement> styleMap)
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Parameters:
      `styleMap` - the styles

  - ### getElementsByTagName

    public DomNodeList<HtmlElement> getElementsByTagName(String tagName)
    Specified by:
      `getElementsByTagName` in interface `Element`

  - ### getStaticElementsByTagName

    public <E extends HtmlElement> List<E> getStaticElementsByTagName(String tagName)
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Type Parameters:
      `E` - the specific HtmlElement type
    Parameters:
      `tagName` - The name of the tag to match on
    Returns:
      A list of matching elements; this is not a live list

  - ### getElementsByTagNameNS

    public DomNodeList<HtmlElement> getElementsByTagNameNS(String namespace, String localName)
    Not yet implemented.
    Specified by:
      `getElementsByTagNameNS` in interface `Element`

  - ### getSchemaTypeInfo

    public TypeInfo getSchemaTypeInfo()
    Not yet implemented.
    Specified by:
      `getSchemaTypeInfo` in interface `Element`

  - ### setIdAttribute

    public void setIdAttribute(String name, boolean isId)
    Not yet implemented.
    Specified by:
      `setIdAttribute` in interface `Element`

  - ### setIdAttributeNS

    public void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
    Not yet implemented.
    Specified by:
      `setIdAttributeNS` in interface `Element`

  - ### setAttributeNode

    public Attr setAttributeNode(Attr attribute)
    Specified by:
      `setAttributeNode` in interface `Element`

  - ### setAttributeNodeNS

    public Attr setAttributeNodeNS(Attr attribute)
    Not yet implemented.
    Specified by:
      `setAttributeNodeNS` in interface `Element`

  - ### setIdAttributeNode

    public final void setIdAttributeNode(Attr idAttr, boolean isId)
    Not yet implemented.
    Specified by:
      `setIdAttributeNode` in interface `Element`

  - ### cloneNode

    public DomNode cloneNode(boolean deep)
    Specified by:
      `cloneNode` in interface `Node`
    Overrides:
      `cloneNode` in class `DomNode`

  - ### getId

    public final String getId()
    Returns:
      the identifier of this element

  - ### setId

    public final void setId(String newId)
    Sets the identifier this element.
    Parameters:
      `newId` - the new identifier of this element

  - ### getFirstElementChild

    public DomElement getFirstElementChild()
    Returns the first child element node of this element. null if this element has no child elements.
    Returns:
      the first child element node of this element. null if this element has no child elements

  - ### getLastElementChild

    public DomElement getLastElementChild()
    Returns the last child element node of this element. null if this element has no child elements.
    Returns:
      the last child element node of this element. null if this element has no child elements

  - ### getChildElementCount

    public int getChildElementCount()
    Returns the current number of element nodes that are children of this element.
    Returns:
      the current number of element nodes that are children of this element.

  - ### getChildElements

    public final Iterable<DomElement> getChildElements()
    Returns:
      an Iterable over the DomElement children of this object, i.e. excluding the non-element nodes

  - ### toString

    public String toString()
    Returns a string representation of this element.
    Overrides:
      `toString` in class `Object`
    Returns:
      a string representation of this element

  - ### click

    public <P extends Page> P click() throws IOException
    Simulates clicking on this element, returning the page in the window that has the focus after the element has been clicked. Note that the returned page may or may not be the same as the original page, depending on the type of element being clicked, the presence of JavaScript action listeners, etc.
    This only clicks the element if it is visible and enabled (isDisplayed() & !isDisabled()). In case the element is not visible and/or disabled, only a log output is generated.
    If you circumvent the visible/disabled check use click(shiftKey, ctrlKey, altKey, true, true, false)
    Type Parameters:
      `P` - the page type
    Returns:
      the page contained in the current window as returned by `WebClient.getCurrentWindow()`
    Throws:
      `IOException` - if an IO error occurs

  - ### click

    public <P extends Page> P click(boolean shiftKey, boolean ctrlKey, boolean altKey) throws IOException
    Simulates clicking on this element, returning the page in the window that has the focus after the element has been clicked. Note that the returned page may or may not be the same as the original page, depending on the type of element being clicked, the presence of JavaScript action listeners, etc.
    This only clicks the element if it is visible and enabled (isDisplayed() & !isDisabled()). In case the element is not visible and/or disabled, only a log output is generated.
    If you circumvent the visible/disabled check use click(shiftKey, ctrlKey, altKey, true, true, false)
    Type Parameters:
      `P` - the page type
    Parameters:
      `shiftKey` - `true` if SHIFT is pressed during the click
      `ctrlKey` - `true` if CTRL is pressed during the click
      `altKey` - `true` if ALT is pressed during the click
    Returns:
      the page contained in the current window as returned by `WebClient.getCurrentWindow()`
    Throws:
      `IOException` - if an IO error occurs

  - ### click

    public <P extends Page> P click(boolean shiftKey, boolean ctrlKey, boolean altKey, boolean triggerMouseEvents) throws IOException
    Simulates clicking on this element, returning the page in the window that has the focus after the element has been clicked. Note that the returned page may or may not be the same as the original page, depending on the type of element being clicked, the presence of JavaScript action listeners, etc.
    This only clicks the element if it is visible and enabled (isDisplayed() & !isDisabled()). In case the element is not visible and/or disabled, only a log output is generated.
    If you circumvent the visible/disabled check use click(shiftKey, ctrlKey, altKey, true, true, false)
    Type Parameters:
      `P` - the page type
    Parameters:
      `shiftKey` - `true` if SHIFT is pressed during the click
      `ctrlKey` - `true` if CTRL is pressed during the click
      `altKey` - `true` if ALT is pressed during the click
      `triggerMouseEvents` - if true trigger the mouse events also
    Returns:
      the page contained in the current window as returned by `WebClient.getCurrentWindow()`
    Throws:
      `IOException` - if an IO error occurs

  - ### isDisabledElementAndDisabled

    protected boolean isDisabledElementAndDisabled()
    Returns:
      true if this is an `DisabledElement` and disabled

  - ### click

    public <P extends Page> P click(boolean shiftKey, boolean ctrlKey, boolean altKey, boolean triggerMouseEvents, boolean handleFocus, boolean ignoreVisibility, boolean disableProcessLabelAfterBubbling) throws IOException
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Simulates clicking on this element, returning the page in the window that has the focus after the element has been clicked. Note that the returned page may or may not be the same as the original page, depending on the type of element being clicked, the presence of JavaScript action listeners, etc.
    Type Parameters:
      `P` - the page type
    Parameters:
      `shiftKey` - `true` if SHIFT is pressed during the click
      `ctrlKey` - `true` if CTRL is pressed during the click
      `altKey` - `true` if ALT is pressed during the click
      `triggerMouseEvents` - if true trigger the mouse events also
      `handleFocus` - if true set the focus (and trigger the event)
      `ignoreVisibility` - whether to ignore visibility or not
      `disableProcessLabelAfterBubbling` - ignore label processing
    Returns:
      the page contained in the current window as returned by `WebClient.getCurrentWindow()`
    Throws:
      `IOException` - if an IO error occurs

  - ### getEventTargetElement

    protected DomNode getEventTargetElement()
    Returns the event target element. This could be overridden by subclasses to have other targets. The default implementation returns 'this'.
    Returns:
      the event target element.

  - ### click

    public <P extends Page> P click(org.htmlunit.javascript.host.event.Event event, boolean shiftKey, boolean ctrlKey, boolean altKey, boolean ignoreVisibility) throws IOException
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Simulates clicking on this element, returning the page in the window that has the focus after the element has been clicked. Note that the returned page may or may not be the same as the original page, depending on the type of element being clicked, the presence of JavaScript action listeners, etc.
    Type Parameters:
      `P` - the page type
    Parameters:
      `event` - the click event used
      `shiftKey` - `true` if SHIFT is pressed during the click
      `ctrlKey` - `true` if CTRL is pressed during the click
      `altKey` - `true` if ALT is pressed during the click
      `ignoreVisibility` - whether to ignore visibility or not
    Returns:
      the page contained in the current window as returned by `WebClient.getCurrentWindow()`
    Throws:
      `IOException` - if an IO error occurs

  - ### doClickStateUpdate

    protected boolean doClickStateUpdate(boolean shiftKey, boolean ctrlKey) throws IOException
    This method implements the control state update part of the click action.

    The default implementation only calls doClickStateUpdate on parent's DomElement (if any). Subclasses requiring different behavior (like `HtmlSubmitInput`) will override this method.

    Parameters:
      `shiftKey` - `true` if SHIFT is pressed
      `ctrlKey` - `true` if CTRL is pressed
    Returns:
      true if doClickFireEvent method has to be called later on (to signal, that the value was changed)
    Throws:
      `IOException` - if an IO error occurs

  - ### propagateClickStateUpdateToParent

    protected boolean propagateClickStateUpdateToParent()
    Returns:
      true or false
    See Also:
      - `Usually the click is propagated to the parent. Overwrite if you like to disable this.`

  - ### doClickFireChangeEvent

    protected void doClickFireChangeEvent()
    This method implements the control onchange handler call during the click action.

  - ### doClickFireClickEvent

    protected ScriptResult doClickFireClickEvent(org.htmlunit.javascript.host.event.Event event)
    This method implements the control onclick handler call during the click action.
    Parameters:
      `event` - the click event used
    Returns:
      the script result

  - ### dblClick

    public <P extends Page> P dblClick() throws IOException
    Simulates double-clicking on this element, returning the page in the window that has the focus after the element has been clicked. Note that the returned page may or may not be the same as the original page, depending on the type of element being clicked, the presence of JavaScript action listeners, etc. Note also that `click()` is automatically called first.
    Type Parameters:
      `P` - the page type
    Returns:
      the page that occupies this element's window after the element has been double-clicked
    Throws:
      `IOException` - if an IO error occurs

  - ### dblClick

    public <P extends Page> P dblClick(boolean shiftKey, boolean ctrlKey, boolean altKey) throws IOException
    Simulates double-clicking on this element, returning the page in the window that has the focus after the element has been clicked. Note that the returned page may or may not be the same as the original page, depending on the type of element being clicked, the presence of JavaScript action listeners, etc. Note also that `click(boolean, boolean, boolean)` is automatically called first.
    Type Parameters:
      `P` - the page type
    Parameters:
      `shiftKey` - `true` if SHIFT is pressed during the double-click
      `ctrlKey` - `true` if CTRL is pressed during the double-click
      `altKey` - `true` if ALT is pressed during the double-click
    Returns:
      the page that occupies this element's window after the element has been double-clicked
    Throws:
      `IOException` - if an IO error occurs

  - ### mouseOver

    public Page mouseOver()
    Simulates moving the mouse over this element, returning the page which this element's window contains after the mouse move. The returned page may or may not be the same as the original page, depending on JavaScript event handlers, etc.
    Returns:
      the page which this element's window contains after the mouse move

  - ### mouseOver

    public Page mouseOver(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)
    Simulates moving the mouse over this element, returning the page which this element's window contains after the mouse move. The returned page may or may not be the same as the original page, depending on JavaScript event handlers, etc.
    Parameters:
      `shiftKey` - `true` if SHIFT is pressed during the mouse move
      `ctrlKey` - `true` if CTRL is pressed during the mouse move
      `altKey` - `true` if ALT is pressed during the mouse move
      `button` - the button code, must be `MouseEvent.BUTTON_LEFT`, `MouseEvent.BUTTON_MIDDLE` or `MouseEvent.BUTTON_RIGHT`
    Returns:
      the page which this element's window contains after the mouse move

  - ### mouseMove

    public Page mouseMove()
    Simulates moving the mouse over this element, returning the page which this element's window contains after the mouse move. The returned page may or may not be the same as the original page, depending on JavaScript event handlers, etc.
    Returns:
      the page which this element's window contains after the mouse move

  - ### mouseMove

    public Page mouseMove(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)
    Simulates moving the mouse over this element, returning the page which this element's window contains after the mouse move. The returned page may or may not be the same as the original page, depending on JavaScript event handlers, etc.
    Parameters:
      `shiftKey` - `true` if SHIFT is pressed during the mouse move
      `ctrlKey` - `true` if CTRL is pressed during the mouse move
      `altKey` - `true` if ALT is pressed during the mouse move
      `button` - the button code, must be `MouseEvent.BUTTON_LEFT`, `MouseEvent.BUTTON_MIDDLE` or `MouseEvent.BUTTON_RIGHT`
    Returns:
      the page which this element's window contains after the mouse move

  - ### mouseOut

    public Page mouseOut()
    Simulates moving the mouse out of this element, returning the page which this element's window contains after the mouse move. The returned page may or may not be the same as the original page, depending on JavaScript event handlers, etc.
    Returns:
      the page which this element's window contains after the mouse move

  - ### mouseOut

    public Page mouseOut(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)
    Simulates moving the mouse out of this element, returning the page which this element's window contains after the mouse move. The returned page may or may not be the same as the original page, depending on JavaScript event handlers, etc.
    Parameters:
      `shiftKey` - `true` if SHIFT is pressed during the mouse move
      `ctrlKey` - `true` if CTRL is pressed during the mouse move
      `altKey` - `true` if ALT is pressed during the mouse move
      `button` - the button code, must be `MouseEvent.BUTTON_LEFT`, `MouseEvent.BUTTON_MIDDLE` or `MouseEvent.BUTTON_RIGHT`
    Returns:
      the page which this element's window contains after the mouse move

  - ### mouseDown

    public Page mouseDown()
    Simulates clicking the mouse on this element, returning the page which this element's window contains after the mouse click. The returned page may or may not be the same as the original page, depending on JavaScript event handlers, etc.
    Returns:
      the page which this element's window contains after the mouse click

  - ### mouseDown

    public Page mouseDown(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)
    Simulates clicking the mouse on this element, returning the page which this element's window contains after the mouse click. The returned page may or may not be the same as the original page, depending on JavaScript event handlers, etc.
    Parameters:
      `shiftKey` - `true` if SHIFT is pressed during the mouse click
      `ctrlKey` - `true` if CTRL is pressed during the mouse click
      `altKey` - `true` if ALT is pressed during the mouse click
      `button` - the button code, must be `MouseEvent.BUTTON_LEFT`, `MouseEvent.BUTTON_MIDDLE` or `MouseEvent.BUTTON_RIGHT`
    Returns:
      the page which this element's window contains after the mouse click

  - ### mouseUp

    public Page mouseUp()
    Simulates releasing the mouse click on this element, returning the page which this element's window contains after the mouse click release. The returned page may or may not be the same as the original page, depending on JavaScript event handlers, etc.
    Returns:
      the page which this element's window contains after the mouse click release

  - ### mouseUp

    public Page mouseUp(boolean shiftKey, boolean ctrlKey, boolean altKey, int button)
    Simulates releasing the mouse click on this element, returning the page which this element's window contains after the mouse click release. The returned page may or may not be the same as the original page, depending on JavaScript event handlers, etc.
    Parameters:
      `shiftKey` - `true` if SHIFT is pressed during the mouse click release
      `ctrlKey` - `true` if CTRL is pressed during the mouse click release
      `altKey` - `true` if ALT is pressed during the mouse click release
      `button` - the button code, must be `MouseEvent.BUTTON_LEFT`, `MouseEvent.BUTTON_MIDDLE` or `MouseEvent.BUTTON_RIGHT`
    Returns:
      the page which this element's window contains after the mouse click release

  - ### rightClick

    public Page rightClick()
    Simulates right clicking the mouse on this element, returning the page which this element's window contains after the mouse click. The returned page may or may not be the same as the original page, depending on JavaScript event handlers, etc.
    Returns:
      the page which this element's window contains after the mouse click

  - ### rightClick

    public Page rightClick(boolean shiftKey, boolean ctrlKey, boolean altKey)
    Simulates right clicking the mouse on this element, returning the page which this element's window contains after the mouse click. The returned page may or may not be the same as the original page, depending on JavaScript event handlers, etc.
    Parameters:
      `shiftKey` - `true` if SHIFT is pressed during the mouse click
      `ctrlKey` - `true` if CTRL is pressed during the mouse click
      `altKey` - `true` if ALT is pressed during the mouse click
    Returns:
      the page which this element's window contains after the mouse click

  - ### fireEvent

    public ScriptResult fireEvent(String eventType)
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Shortcut for `fireEvent(Event)`.
    Parameters:
      `eventType` - the event type (like "load", "click")
    Returns:
      the execution result, or `null` if nothing is executed

  - ### fireEvent

    public ScriptResult fireEvent(org.htmlunit.javascript.host.event.Event event)
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Fires the event on the element. Nothing is done if JavaScript is disabled.
    Parameters:
      `event` - the event to fire
    Returns:
      the execution result, or `null` if nothing is executed

  - ### preventDefault

    protected void preventDefault()
    This method is called if the current fired event is canceled by `preventDefault()`.

    The default implementation does nothing.

  - ### focus

    public void focus()
    Sets the focus on this element.

  - ### blur

    public void blur()
    Removes focus from this element.

  - ### removeFocus

    public void removeFocus()
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Gets notified that it has lost the focus.

  - ### isStateUpdateFirst

    protected boolean isStateUpdateFirst()
    Returns `true` if state updates should be done before onclick event handling. This method returns `false` by default, and is expected to be overridden to return `true` by derived classes like `HtmlCheckBoxInput`.
    Returns:
      `true` if state updates should be done before onclick event handling

  - ### isMouseOver

    public boolean isMouseOver()
    Returns whether the Mouse is currently over this element or not.
    Returns:
      whether the Mouse is currently over this element or not

  - ### matches

    public boolean matches(String selectorString)
    Returns true if the element would be selected by the specified selector string; otherwise, returns false.
    Parameters:
      `selectorString` - the selector to test
    Returns:
      true if the element would be selected by the specified selector string; otherwise, returns false.

  - ### setNodeValue

    public void setNodeValue(String value)
    Specified by:
      `setNodeValue` in interface `Node`

  - ### setDefaults

    public void setDefaults(org.htmlunit.css.ComputedCssStyleDeclaration style)
    Callback method which allows different HTML element types to perform custom initialization of computed styles. For example, body elements in most browsers have default values for their margins.
    Parameters:
      `style` - the style to initialize

  - ### setInnerHtml

    public void setInnerHtml(String source) throws SAXException, IOException
    Replaces all child elements of this element with the supplied value parsed as html.
    Parameters:
      `source` - the new value for the contents of this element
    Throws:
      `SAXException` - in case of error
      `IOException` - in case of error