什么是默认按钮类型? [英] What is the default button type?
问题描述
如果我这样做:
< button name =Save> Save< / button>
我可以确定它在所有浏览器中的行为方式都一样吗?
对于大多数浏览器,类型
$ c $是提交
。
type = submit | button |重置[CI]
该属性声明按钮的类型。可能的值:
submit:创建一个提交按钮。这是默认值。
( http://www.w3.org/TR/html401/interact/forms.html#h-17.5 )
唯一的例外是IE7和以下的默认类型
是按钮
。
Windows Internet Explorer 8及更高版本。此属性的默认值取决于当前的文档兼容模式。在IE8标准模式下,默认值为提交。在其他兼容模式和早期版本的Windows Internet Explorer中,默认值为按钮。
( https://msdn.microsoft.com/en-us/library/ms534696(v =如果旧的IE支持不是问题(老版本的IE也会遇到多个 If I do this: can I be assured that it will behave the same way across all browsers? For most browsers the default 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 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 这篇关于什么是默认按钮类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! 按钮
在一个窗体
和按钮
的文本上传递,而不是 value
)你可能不会为<$ c $ c>按钮提供类型
属性 code>。 <button name="Save">Save</button>
type
of button
is submit
.
type
is button
.
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
.