When giving the focus to the Submit button and then pressing SPACE in the following snippet, it "clicks" (with the keyboard) on th Submit button, and onclick="alert()"
is triggered.
This works on Chrome and Firefox.
Question: is it a general truth (in all browsers, all platforms) that a SPACE keypress on a Submit input (that thas focus) triggers the onclick
? If so, where is it documented?
<form>
<input type="submit" onclick="alert()" />
</form>
Please note that it's not the same question as Submit form with Enter key without submit button?.