Add a button that submits its form.
Acceptance criteria
- 1.Add a button that submits its form.
HTML Tutorial · HTML Tags
These 10 tasks go with the HTML <button> 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 a clickable button in an HTML form or web page. It can contain text, images, or HTML content , unlike which is limited to plain text.” .
1.Add a submit buttonexercise · easy · 10 min
Add a button that submits its form.
Passes when: Add a button that submits its form.
2.A plain buttonexercise · easy · 10 min · practice plan
Add a button that does not submit.
Passes when: Add a button that does not submit.
3.A reset buttonexercise · easy · 10 min · practice plan
Add a button that clears the form.
Passes when: Add a button that clears the form.
4.Disable a buttonexercise · easy · 10 min · practice plan
Add a disabled button.
Passes when: Add a disabled button.
5.A form with two buttonsexercise · medium · 10 min · practice plan
Add a submit button and a reset button in one form.
Passes when: Add a submit button and a reset button in one form.
6.Fix the div used as a buttonbug fix · easy · 8 min
A clickable control is a button.
Passes when: A clickable control is a button.
7.Fix the button that submits by accidentbug fix · easy · 8 min · practice plan
A button inside a form submits unless told otherwise.
Passes when: A button inside a form submits unless told otherwise.
8.Fix the wrong type for clearingbug fix · easy · 8 min · practice plan
Clearing a form is type reset.
Passes when: Clearing a form is type reset.
9.Fix the button that should be disabledbug fix · easy · 8 min · practice plan
The control is not ready to be used yet.
Passes when: The control is not ready to be used yet.
10.Fix the missing reset buttonbug fix · easy · 8 min · practice plan
The form offers no way to clear it.
Passes when: The form offers no way to clear it.
Between them these tasks cover Buttons, type attribute and Submit vs button.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.