Dart API Referencedart:htmlButtonElement

ButtonElement Interface

DOM Button objects expose the HTMLButtonElement HTML5 (or HTMLButtonElement HTML 4) interface, which provides properties and methods (beyond the element object interface they also have available to them by inheritance) for manipulating the layout and presentation of button elements.

Extends

Element

Constructors

Code new ButtonElement() #

ButtonElement();

Methods

Code bool checkValidity() #

Not supported for button elements.
bool checkValidity();

Code void setCustomValidity(String error) #

Not supported for button elements.
void setCustomValidity(String error);

Fields

Code bool autofocus #

The control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form-associated element in a document can have this attribute specified.
bool autofocus;

Code bool disabled #

The control is disabled, meaning that it does not accept any clicks.
bool disabled;

Code final FormElement form #

The form that this button is associated with. If the button is a descendant of a form element, then this attribute is the ID of that form element.

If the button is not a descendant of a form element, then:

  • HTML5 The attribute can be the ID of any form element in the same document.
  • HTML 4 The attribute is null.
final FormElement form;

Code String formAction #

The URI of a program that processes information submitted by the button. If specified, this attribute overrides the action attribute of the <form> element that owns this element.
String formAction;

Code String formEnctype #

String formEnctype;

Code String formMethod #

The HTTP method that the browser uses to submit the form. If specified, this attribute overrides the method attribute of the <form> element that owns this element.
String formMethod;

Code bool formNoValidate #

Indicates that the form is not to be validated when it is submitted. If specified, this attribute overrides the enctype attribute of the <form> element that owns this element.
bool formNoValidate;

Code String formTarget #

A name or keyword indicating where to display the response that is received after submitting the form. If specified, this attribute overrides the target attribute of the <form> element that owns this element.
String formTarget;

Code final NodeList labels #

A list of <label> elements that are labels for this button.
final NodeList labels;

Code String name #

The name of the object when submitted with a form. HTML5 If specified, it must not be the empty string.
String name;

Code String type #

Indicates the behavior of the button. This is an enumerated attribute with the following possible values:

  • submit: The button submits the form. This is the default value if the attribute is not specified, HTML5 or if it is dynamically changed to an empty or invalid value.
  • reset: The button resets the form.
  • button: The button does nothing.
String type;

Code final String validationMessage #

A localized message that describes the validation constraints that the control does not satisfy (if any). This attribute is the empty string if the control is not a candidate for constraint validation (willValidate is false), or it satisfies its constraints.
final String validationMessage;

Code final ValidityState validity #

The validity states that this button is in.
final ValidityState validity;

Code String value #

The current form control value of the button. 
String value;

Code final bool willValidate #

Indicates whether the button is a candidate for constraint validation. It is false if any conditions bar it from constraint validation.
final bool willValidate;

This page includes content from the Mozilla Foundation that is graciously licensed under a Creative Commons: Attribution-Sharealike license. Mozilla has no other association with Dart or dartlang.org. We encourage you to improve the web by contributing to The Mozilla Developer Network.