QuizNot attempted
Select placeholder
1–4 to choose, Enter to submit
Show answer & explanation
Correct answer:
<option value="" disabled selected hidden>(select one)</option>as the first option
- An option with
value=""makesrequiredfail until the user picks a real choice,selectedshows it initially, anddisabled+hiddenstop it being chosen again. - Not a placeholder attribute:
<select>doesn't support one. - Not a label over the select: fragile visually and doesn't affect validation.
- Not value=none: a non-empty value satisfies
required, so '(select one)' could be submitted. - In React drive it with a controlled
value="".