HTML button to NOT submit form

I think this is the most annoying little peculiarity of HTML… That button needs to be of type “button” in order to not submit.

<button type="button">My Button</button>

Update 5-Feb-2019: As per the HTML Living Standard (and also HTML 5 specification):

The missing value default and invalid value default are the Submit
Button state.

Leave a Comment