Class HTMLButtonElement

All Implemented Interfaces:
Serializable, Cloneable, org.htmlunit.corejs.javascript.ConstProperties, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable

public class HTMLButtonElement extends HTMLElement
The JavaScript object that represents a HtmlButton (<button type=...>).
See Also:
  • Field Details

    • labels_

      private NodeList labels_
      "Live" labels collection; has to be a member to have equality (==) working.
  • Constructor Details

    • HTMLButtonElement

      public HTMLButtonElement()
      Creates an instance.
  • Method Details

    • jsConstructor

      public void jsConstructor()
      JavaScript constructor.
      Overrides:
      jsConstructor in class HTMLElement
    • setType

      public void setType(String newType)
      Sets the value of the attribute type.

      Note that there is no GUI change in the shape of the button, so we don't treat it like HTMLInputElement.setType(String).

      Parameters:
      newType - the new type to set
    • getType

      public String getType()
      Returns the type property.
      Returns:
      the type property
    • getLabels

      public NodeList getLabels()
      Returns the labels associated with the element.
      Returns:
      the labels associated with the element
    • getName

      public String getName()
      Returns the value of the JavaScript attribute name.
      Overrides:
      getName in class HTMLElement
      Returns:
      the value of this attribute
    • setName

      public void setName(String newName)
      Sets the value of the JavaScript attribute name.
      Overrides:
      setName in class HTMLElement
      Parameters:
      newName - the new name
    • isDisabled

      public boolean isDisabled()
      Returns true if this element is disabled. Overridden to modify browser configurations.
      Overrides:
      isDisabled in class HTMLElement
      Returns:
      true if this element is disabled
    • setDisabled

      public void setDisabled(boolean disabled)
      Sets whether or not to disable this element. Overridden to modify browser configurations.
      Overrides:
      setDisabled in class HTMLElement
      Parameters:
      disabled - True if this is to be disabled
    • getForm

      public HTMLFormElement getForm()
      Returns the value of the JavaScript form attribute.
      Overrides:
      getForm in class HTMLElement
      Returns:
      the value of the JavaScript form attribute
    • getValue

      public Object getValue()
      Returns the value of the JavaScript attribute value.
      Overrides:
      getValue in class HTMLElement
      Returns:
      the value of this attribute
    • setValue

      public void setValue(Object newValue)
      Sets the value of the JavaScript attribute value.
      Overrides:
      setValue in class HTMLElement
      Parameters:
      newValue - the new value
    • checkValidity

      public boolean checkValidity()
      Checks whether the element has any constraints and whether it satisfies them.
      Returns:
      if the element is valid
    • getValidity

      public ValidityState getValidity()
      Returns:
      a ValidityState with the validity states that this element is in.
    • getWillValidate

      public boolean getWillValidate()
      Returns:
      always false
    • setCustomValidity

      public void setCustomValidity(String message)
      Sets the custom validity message for the element to the specified message.
      Parameters:
      message - the new message
    • isFormNoValidate

      public boolean isFormNoValidate()
      Returns the value of the property formnovalidate.
      Returns:
      the value of this property
    • setFormNoValidate

      public void setFormNoValidate(boolean value)
      Sets the value of the property formnovalidate.
      Parameters:
      value - the new value