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

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

问题描述

没有这样的事情是一个愚蠢的问题,所以我们来看看:< input type ='button'/> < input type ='submit'/>

解决方案

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

< input type =submit> 按钮将在用户点击时提交他们所在的表单,除非您使用JavaScript指定。


There is no such thing as a stupid question, so here we go: What is the difference between <input type='button' /> and <input type='submit' />?

解决方案

<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.

<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天全站免登陆