Firstly, you do not need to manually attach an event to submit the form when the user presses enter - the browser is already processing this.
Oddly enough, this is due to the order of the elements, implicit associations of forms, as well as the fact that IE treats the buttons as submit elements.
Try changing the order of these buttons to see what I mean:
<input type="text" /> <input type="submit" value="Submit" /> <button>Some button</button>
Naturally, the browser is already instructed to listen to the response to enter on the text input. This will cause the browser to click on the corresponding submit button. In addition, since you have not explicitly specified form or related elements with each other through your form attribute, the browser is trying to do this for you.
In your code, the <button> element was considered a text input submit button (because it was the first submit button in implicit form). Thus, at any time when you press enter on text input, the browser naturally triggers the click event of the associated button.
If you reorder the elements, as I said above, we see the opposite. IE binds another <input> element to a text field. And pressing enter in the text field implicitly triggers a click event on the send input.
You can confirm this behavior by comparing the .form attributes of the various elements. For example, adding some id values will give us easier access to them:
<button id="fiz">Some Button</button> <input id="foo" type="text" /> <input id="bar" type="submit" value="Submit" />
Then do some quick comparisons:
var button = document.getElementById("fiz"); var text = document.getElementById("foo"); var submit = document.getElementById("bar"); button.form === text.form; // true submit.form === text.form; // true button.form === submit.form; // true
So, in the end, you can eliminate the ambiguity between the two buttons by declaring the <button> element equal to type='button' or by placing it after the intended submit button.