HTMLButtonElement object
Implements the document object model (DOM) representation of the button element.
![]() |
DOM Information
Inheritance Hierarchy
Members
The HTMLButtonElement object has these types of members:
Methods
The HTMLButtonElement object has these methods.
| Method | Description |
|---|---|
| checkValidity |
Returns whether a form will validate when it is submitted, without having to submit it. |
| setCustomValidity |
Sets a custom error message that is displayed when a form is submitted. |
Properties
The HTMLButtonElement object has these properties.
| Property | Access type | Description |
|---|---|---|
|
Read/write |
Provides a way to direct a user to a specific field when a document loads. | |
|
Read/write |
Overrides the action attribute (where the data on a form is sent) on the parent form element. | |
|
Read/write |
Used to override the encoding (formEnctype attribute) specified on the form element. | |
|
Read/write |
Overrides the submit method attribute previously specified on a form element. | |
|
Read/write |
Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. | |
|
Read/write |
Overrides the target attribute on a form element. | |
|
Read-only |
Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. | |
|
Read-only |
Returns a ValidityState object that represents the validity states of an element. | |
|
Read-only |
Returns whether an element will successfully validate based on forms validation rules and constraints. |
See also
