Platform Support
| Mozilla | Chrome | Safari | Opera | IE | Netscape | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|---|
Constructors
| Constructor | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape | ||
|---|---|---|---|---|---|---|---|---|---|
|
HTMLButtonElement Constructor() : HTMLButtonElement
Creates an instance of the HTMLButtonElement.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | ||
HTMLButtonElement() : HTMLButtonElementCreates an instance of the HTMLButtonElement. Returns
|
|||||||||
Properties
| Property | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape |
|---|---|---|---|---|---|---|---|
|
autofocus
: Boolean
Allows the user to indicate that a control is to be focused as soon as the page is loaded, allowing the user to just start
typing without having to manually focus the main control.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
disabled
: Boolean
Disables form controls.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
form
: HTMLFormElement
Used to explicitly associate the button element with its form owner.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
formAction
: String
Specifies the action for the form element.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
formEnctype
: String
Specifies the encoded type for the form.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
formMethod
: String
Specifies the method for the form (GET, POST, PUT, DELETE)
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
formNoValidate
: String
Specifies whether form is validated during submission.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
formTarget
: String
Specifies the target for the form.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
name
: String
Specifies the name of the form control.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
type
: String
Specifies the type of the form control.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
value
: String
Specifies the value for the purposes of form submission.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
willValidate
: Boolean
Specifies whether the element will be validated when the form is submitted.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
validity
: ValidityState
Specifies the validity of the element.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
validationMessage
: String
Specifies a suitably localized message that the user agent would show the user if this were the only form control with a validity
constraint problem.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
labels
: NodeList
Returns a NodeList of all the label elements that the form control is associated with.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
Inherited Functions
| Method | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
getElementsByClassName(String classNames) : NodeList
Returns a NodeList containing all the
Element nodes with the specified classNames. |
Show Details | 1.9+ | 5.0+ | 3.1+ | 9.51+ | no | no | |||||
|
Parameters
Returns
|
||||||||||||
Functions
| Method | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape | |||
|---|---|---|---|---|---|---|---|---|---|---|
|
checkValidity() : Boolean
The user agent must instanceally validate the constraints of the form element, and return true if the constraint validation
return a positive result, and false if it returned a negative result.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | |||
|
Returns
|
||||||||||
|
setCustomValidity(String error) :
void
Sets the custom validity error message to the value of the given message argument.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | |||
|
Parameters
|
||||||||||
References
Availability
JavaScript 1.2|WhatWG