Sometimes, we want to make a button not submit a form with HTML.
In this article, we’ll look at how to make a button not submit a form with HTML.
How to make a button not submit a form with HTML?
To make a button not submit a form with HTML, we can set the type
attribute of the button to button
.
For instance, we write
<button type="button">Submit</button>
to set the type
attribute of the button to button
to stop the button from submitting the form when we click it.
Conclusion
To make a button not submit a form with HTML, we can set the type
attribute of the button to button
.