I have an HTML form with a single submit
input, but also various button
elements. When the user presses the \'enter\' key, I\'d expect it to actually s
You don't need JavaScript to choose your default submit button or input. You just need to mark it up with type="submit"
, and the other buttons mark them with type="button"
. In your example:
<button type="button" onclick="return myFunc1()">Button 1</button>
<input type="submit" name="go" value="Submit"/>