skip to content

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 pageshow

explore

questions

page 2 of 2

A 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?

level: principalimportance: should knowfreq 33%

basics

~20 s

Native 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.

open as a page

In HTML, what is the difference between the <progress> and <meter> elements, and when do you use each?

level: juniorimportance: nice to knowfreq 24%

basics

~20 s

The 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.

open as a page

showing 31–32 of 32