Add a form element containing a submit button.
Acceptance criteria
- 1.Add a form element containing a submit button.
HTML Tutorial · HTML Forms
These 10 tasks go with the HTML Forms Overview 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: “HTML forms are essential for collecting user input on a website. They allow users to enter information like names, email addresses, passwords, or upload files. These inputs can then be sent to a server for processing, such as logging in, signing up, or submitting feedback.” .
1.Add a formexercise · easy · 10 min
Add a form element containing a submit button.
Passes when: Add a form element containing a submit button.
2.Set the actionexercise · easy · 10 min · practice plan
Point the form at /subscribe.
Passes when: Point the form at /subscribe.
3.Set the methodexercise · easy · 10 min · practice plan
Make the form submit with POST.
Passes when: Make the form submit with POST.
4.Name a fieldexercise · easy · 10 min · practice plan
Add a text input named email so it is submitted.
Passes when: Add a text input named email so it is submitted.
5.Build a minimal working formexercise · medium · 10 min · practice plan
Combine action, method, a named field and a submit button.
Passes when: Combine action, method, a named field and a submit button.
6.Fix the input outside the formbug fix · easy · 8 min
A field outside the form is never submitted.
Passes when: A field outside the form is never submitted.
7.Fix the missing namebug fix · easy · 8 min · practice plan
Without a name the value is never sent.
Passes when: Without a name the value is never sent.
8.Fix the wrong method valuebug fix · easy · 8 min · practice plan
The method should be post, not send.
Passes when: The method should be post, not send.
9.Fix the wrong attribute for the targetbug fix · easy · 8 min · practice plan
Forms use action, not href.
Passes when: Forms use action, not href.
10.Fix the div used as a formbug fix · easy · 8 min · practice plan
A div cannot submit anything.
Passes when: A div cannot submit anything.
Between them these tasks cover form element, action and method and Submit controls.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.