Why a button is clicked when a form is submitted?
问题 Say, I have a form with a text input and a submit button. If there are no buttons in the form, just submit event triggers, but if there is at least one button with no type attribute or with type="submit" , it clicks it too. Now, when I enter something in the input and then press Enter, I see that both button click and form submit events are triggered. Example: <form> <input type="text" /> <button onclick="alert('submitted');">Submit</button> </form> I suppose the form clicks the button