< input type ='button'/>之间的区别和< input type ='submit'/> [英] Difference between <input type='button' /> and <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.
这篇关于< input type ='button'/>之间的区别和< input type ='submit'/>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!