How to make a button not submit a form with HTML?

Spread the love

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.

Leave a Reply

Your email address will not be published.