Forms and Inputs
The only part of HTML with real built-in behavior: controls, labels, native validation, submission, and autofill. Interviewers ask about forms because most bugs and accessibility failures in real apps come from reimplementing what the platform already does.
part ofHTMLoverview, primer and where to startread it →on this pageshowhide
explore
- Input Types and Attributes5 questions
- Labels and Fieldsets5 questions
- Select, Textarea, and Other Controls5 questions
- Constraint Validation API6 questions
- Submission Semantics and FormData6 questions
- Autofill and autocomplete Tokens5 questions
questions
page 2 of 2A design system needs inline, styled, consistently worded error messages on every form. How would you decide between keeping the browser's native validation bubbles and switching them off to render your own, and what must you reproduce if you take it over?
basics
~20 sNative bubbles are free but unstyleable, shown one at a time, dismissed on blur, worded in the browser's language, and absent from the DOM. Taking over means adding novalidate, keeping the constraint attributes, and reproducing the message, the focus move and the announcement yourself.
In HTML, what is the difference between the <progress> and <meter> elements, and when do you use each?
basics
~20 sThe progress element shows how far a task has advanced toward completion, and shows an indeterminate state when its value is omitted. The meter element shows a scalar measurement inside a known range, such as disk usage or a score, which is not moving toward any finish.
showing 31–32 of 32