HTML Interview10 Q&A

HTML Forms Interview

Interview Q&A on form structure, common controls, validation basics, and accessibility.

1Purpose of <form>?easy
Answer: Collects user input and submits data to server endpoint.
2Difference between GET and POST?medium
Answer: GET appends data to URL; POST sends data in request body.
3Why use label with inputs?easy
Answer: Better accessibility and larger click target; bind using for + input id.
4Common input types?easy
Answer: text, email, password, number, date, checkbox, radio, file, submit.
5Use of name attribute?easy
Answer: It is the key used in form submission payload.
6What does required do?easy
Answer: Enforces browser-side mandatory field validation.
7placeholder vs label?medium
Answer: Placeholder is hint text; label identifies field and should not be skipped.
8How to group related fields?medium
Answer: Use fieldset and legend.
9What is client-side validation?medium
Answer: Browser checks input constraints before submit; still requires server-side validation.
10Interview best-practice summary?medium
Answer: Accessible labels, semantic grouping, proper types, and secure server validation.