Button type Property
Button Object
Definition and Usage
The type property sets or returns the type of the button.
Tip: Always specify the type attribute for a button. The default type in IE is "button", while in other browsers (and in the W3C specification) it is "submit".
Syntax
buttonObject.type=
value
The type property can have the following values:
| Value | Description |
|---|---|
| submit | button is a submit button (the default value for all browsers except IE) |
| button | button is a clickable button (the default value of IE) |
| reset | button is a reset button (clears form data) |
Browser support





All major browsers support the type property.
Example
Example
Return the type of the button:
Try it »
Button Object