Add a text input named username.
Acceptance criteria
- 1.Add a text input named username.
HTML Tutorial · HTML Tags
These 10 tasks go with the HTML <input> 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 to create interactive form controls for user input . It can represent a text field, checkbox, radio button, file selector, password box, email, number input , and more. The type of input is determined by the type attribute .” .
1.A text fieldexercise · easy · 10 min
Add a text input named username.
Passes when: Add a text input named username.
2.An email fieldexercise · easy · 10 min · practice plan
Add an email input so the browser validates the format.
Passes when: Add an email input so the browser validates the format.
3.Make it requiredexercise · easy · 10 min · practice plan
Mark the field as required.
Passes when: Mark the field as required.
4.Add a placeholderexercise · easy · 10 min · practice plan
Show a hint inside the field.
Passes when: Show a hint inside the field.
5.A checkbox with a labelexercise · medium · 10 min · practice plan
Add a checkbox tied to a label.
Passes when: Add a checkbox tied to a label.
6.Fix the missing typebug fix · easy · 8 min
The field should say what kind of value it takes.
Passes when: The field should say what kind of value it takes.
7.Fix the email field typed as textbug fix · easy · 8 min · practice plan
An email address has its own input type.
Passes when: An email address has its own input type.
8.Fix the required field that is optionalbug fix · easy · 8 min · practice plan
The field is meant to be mandatory.
Passes when: The field is meant to be mandatory.
9.Fix the hint in the wrong attributebug fix · easy · 8 min · practice plan
In-field hints use placeholder.
Passes when: In-field hints use placeholder.
10.Fix the label not tied to the boxbug fix · easy · 8 min · practice plan
The label's for must match the input's id.
Passes when: The label's for must match the input's id.
Between them these tasks cover Input types, required and placeholder.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.