When using the <button>
it is important to use the "type" attribute: in most browsers (correctly), the "send" type is used by default, which makes it work as an element of the form presentation. Instead, you can set the type to "button", which causes the button to have its own behavior other than triggering event handlers. In this way:
In this way:
<button onclick="check()" type=button>Submit</button>
will hold the button from implicit form submission.
source share