当<按钮>标签点击?会提交表格吗? [英] what's the standard behavior when < button > tag click? will it submit the form?

查看:80
本文介绍了当<按钮>标签点击?会提交表格吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标签< button> ,而不是< input type = button>

推荐答案

如果按钮在表单内,默认行为是提交。

If the button is within a form, the default behavior is submit.

如果该按钮不在一个表单内,它不会执行任何操作。

If the button is not within a form, it will do nothing.

但是要知道!


始终指定
的type属性。
Internet Explorer的默认类型是按钮,而其他浏览器中的
(在W3C
规范中)则为提交。

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

取自 http://www.w3schools。 com / tags / tag_button.asp

这篇关于当&lt;按钮&gt;标签点击?会提交表格吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆