Accessibility · Junior · Question 72 of 75
Why should a form have a real <form> and a submit button?
- 1Enter submits it, and semantics work out of the box
- 2Browsers can't send requests without a form element
- 3JavaScript can't read inputs outside of a form
Show the answer
Correct answer: Enter submits it, and semantics work out of the box
Explanation
Pressing Enter in a field submits the form, which keyboard users rely on. A div with an onClick on a pseudo-button loses that.