What is the default button type?
If I do this:
<button name="Save">Save</button>
can I be assured that it will behave the same way across all browsers?
For most browsers the default type
of button
is submit
.
type = submit|button|reset [CI]
This attribute declares the type of the button. Possible values:
submit: Creates a submit button. This is the default value.
(http://www.w3.org/TR/html401/interact/forms.html#h-17.5)
The only exception to this is IE7 and below where the default type
is button
.
Windows Internet Explorer 8 and later. The default value of this attribute depends on the current document compatibility mode. In IE8 Standards mode, the default value is submit. In other compatibility modes and earlier versions of Windows Internet Explorer, the default value is button.
(https://msdn.microsoft.com/en-us/library/ms534696(v=vs.85).aspx)
If old IE support is not an issue (older versions of IE also have trouble with multiple button
s on one form
and the text of thebutton
being passed through instead of thevalue
) you can probably get away with not supplying the type
attribute for a button
.
As far as I know the default is "submit"
except for IE which default is "button"
See this for more details
Edit
According to the Microsoft Developer Network specification:
In IE8 Standards mode, the default value is submit. In other compatibility modes and earlier versions of Windows Internet Explorer, the default value is button.