If I do this:
<button name="Save">Save</button>
can I be assured that it will behave the same way across all browsers?
The button is a clickable button. submit. The button is a submit button (submits form-data) reset. The button is a reset button (resets the form-data to its initial values)
Button Types submit — Submits the current form data. (This is default.) reset — Resets data in the current form. button — Just a button.
The type attribute on a <button> tag specifies the type of button to create. Options are: button , submit , and reset . When clicked, each button type has its own behavior.
The two types of Button sizes are default and small.
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.
The input button maybe looks different in the browsers but the function of the input will be the same. check: button ,W3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With