Difference between type submit and button of <button> tag in HTML?
Dung Do Tien May 29 2020 850
I have a login form with two text boxes and a button. I see the type of <button> tag has two options is submit and button. What is the difference between them?
<button type="submit" id="submitForm" >Login</button>
<button type="button" id="submitForm" >Login</button>
Have 1 answer(s) found.
Sandeep Kumar Jul 24 2020
type="submit": Help submit a form, it use to working with a <form> tag. This is the default feature.
type="button": You can not submit a form, it's helpful in some case manipulation with <input> tags but doesn't want to submit or reload the page.
* Type maximum 2000 characters.
* All comments have to wait approved before display.
* Please polite comment and respect questions and answers of others.