难道一个&LT;按钮和GT;类型已经被定义? [英] Does a <button> TYPE have to be defined?
本文介绍了难道一个&LT;按钮和GT;类型已经被定义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在使用按钮标签,并type属性已经被定义,或者是它的语义只是有?
&LT;按钮和gt;点击ME&LT; /按钮&GT;
解决方案
没有,你没有指定它,它默认值提交
。
请参阅的HTML 4.x的规格:
类型(按钮|提交|复位)提交 - 用作表单按钮 -
^^^^^^默认值
与表单action属性,它说的不是给一个默认值#REQUIRED进行比较。
动作%URI; #REQUIRED - 服务器端的表单处理程序 -
When using the button tag, does the type attribute have to be defined, or is it semantic to just have?
<button>Click Me</button>
解决方案
No, you don't have to specify it, it defaults to the value submit
.
See the HTML 4.x specification:
type (button|submit|reset) submit -- for use as form button --
^^^^^^ default value
Compare with the action attribute for forms where it says #REQUIRED instead of giving a default value.
action %URI; #REQUIRED -- server-side form handler --
这篇关于难道一个&LT;按钮和GT;类型已经被定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文