HTML: Define the action of "enter" in a <form>

Viewed 5791

I've got an HTML <form> with a few <button>s and an <input type="submit">:

<form>
    <button>first button</button>
    <button>second button</button>
    <input type="text">
    <input type="submit">
</form>

But when enter is pressed while in the text field, the "first button" is activated instead of the "submit" button.

How can I make enter trigger the "submit" button?

2 Answers
Related