HTML button to NOT submit form
- by arik-so
Hello,
I have a form. Outside that form, I have a button. A simple button, like this:
<button>My Button</button>
Nevertheless, when I click it, it submits the form. Here's the code:
<form id="myform">
<input />
</form>
<button>My Button</button>
All this button should do is some JavaScript. But…