Skip to content

QuizNot attempted

Select placeholder

How do you show "(select one)" in a required <select> that can't be submitted as a choice?
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="" makes required fail until the user picks a real choice, selected shows it initially, and disabled + hidden stop 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="".