Add an option whose submitted value differs from its text.
Acceptance criteria
- 1.Add an option whose submitted value differs from its text.
HTML Tutorial · HTML Tags
These 10 tasks go with the HTML <option> Tag chapter. 5 of them ask you to build something small from scratch; 5 give you code that is already broken and ask you to work out why. Set aside about 90 minutes for the whole set, though you can do them in any order.
Nothing here is marked by a person. When you press Submit, the editor checks your code against the points listed under each task and tells you straight away what passed and what didn't (you need a free account to submit). If you get stuck, there are hints, and a worked solution once you've had a go. The first 2 tasks are free; the rest are part of the practice plan.
If it's been a while since you read the chapter, here is how it starts: “The tag is used inside a element to define a single option in a drop-down list. Each represents a selectable value that the user can choose. The tag must always be a child of or .” .
1.Give an option a valueexercise · easy · 10 min
Add an option whose submitted value differs from its text.
Passes when: Add an option whose submitted value differs from its text.
2.Three optionsexercise · easy · 10 min · practice plan
Add three choices to the dropdown.
Passes when: Add three choices to the dropdown.
3.A placeholder optionexercise · easy · 10 min · practice plan
Add a disabled first option that acts as a prompt.
Passes when: Add a disabled first option that acts as a prompt.
4.Preselect a choiceexercise · easy · 10 min · practice plan
Mark one option as selected.
Passes when: Mark one option as selected.
5.A complete dropdownexercise · medium · 10 min · practice plan
Build a named dropdown with a prompt and two real choices.
Passes when: Build a named dropdown with a prompt and two real choices.
6.Fix the option with no valuebug fix · easy · 8 min
Without a value the option submits its text.
Passes when: Without a value the option submits its text.
7.Fix the missing third optionbug fix · easy · 8 min · practice plan
One choice is missing.
Passes when: One choice is missing.
8.Fix the prompt that can be chosenbug fix · easy · 8 min · practice plan
A prompt should not be a selectable answer.
Passes when: A prompt should not be a selectable answer.
9.Fix the default marked with checkedbug fix · easy · 8 min · practice plan
Options use selected, not checked.
Passes when: Options use selected, not checked.
10.Fix the dropdown missing its namebug fix · easy · 8 min · practice plan
The choice cannot be submitted without a name.
Passes when: The choice cannot be submitted without a name.
Between them these tasks cover Options, value attribute and Defaults.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.