Difference between <input type='button' /> and <input type='submit' />

前端 未结 8 2137
不思量自难忘°
不思量自难忘° 2020-11-22 05:17

What is the difference between HTML and ?

相关标签:
8条回答
  • 2020-11-22 05:46

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

    0 讨论(0)
  • 2020-11-22 05:47

    W3C make it clear, on the specification about Button element

    Button may be seen as a generic class for all kind of Buttons with no default behavior.

    W3C

    0 讨论(0)
提交回复
热议问题