Easy Tutorial
❮ Prop Tableheader Colspan Event Oncontextmenu ❯

Button type Attribute


Definition and Usage

The type attribute sets or returns the type of the button.

Tip: Always specify the type attribute for a button. The default type in IE browsers is "button", while in other browsers (and in the W3C specification) it is "submit".

Syntax

The type attribute can have the following values:

Value Description
submit The button is a submit button (default value for all browsers except IE)
button The button is a clickable button (default value for IE)
reset The button is a reset button (clears form data)

Browser Support

All major browsers support the type attribute.


Example

Return the type of the button:

❮ Prop Tableheader Colspan Event Oncontextmenu ❯