<input type='button'/> 的区别和 <input type='submit'/> [英] Difference between <input type='button' /> and <input type='submit' />

查看:44
本文介绍了<input type='button'/> 的区别和 <input type='submit'/>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTML <input type='button'/> 有什么区别?

What is the difference between HTML <input type='button' /> and <input type='submit' />?

推荐答案

<input type="button"/> 按钮不会提交表单 - 它们默认不做任何事情.它们通常与 JavaScript 结合使用,作为 AJAX 应用程序的一部分.

<input type="button" /> buttons will not submit a form - they don't do anything by default. They're generally used in conjunction with JavaScript as part of an AJAX application.

按钮将在用户点击它们时提交它们所在的表单,除非您使用 JavaScript 另行指定.

<input type="submit"> buttons will submit the form they are in when the user clicks on them, unless you specify otherwise with JavaScript.

这篇关于&lt;input type='button'/&gt; 的区别和 &lt;input type='submit'/&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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