Add a details element with a summary and body text.
Acceptance criteria
- 1.Add a details element with a summary and body text.
HTML Tutorial · HTML Tags
These 10 tasks go with the HTML <details> 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 collapsible content block that the user can open or close . It is often used for FAQs, additional information, or disclosure sections . The tag is typically used inside to define the visible heading that toggles the content.” .
1.Add a disclosureexercise · easy · 10 min
Add a details element with a summary and body text.
Passes when: Add a details element with a summary and body text.
2.Open by defaultexercise · easy · 10 min · practice plan
Make the disclosure start expanded.
Passes when: Make the disclosure start expanded.
3.A question and answerexercise · easy · 10 min · practice plan
Use details for one FAQ entry.
Passes when: Use details for one FAQ entry.
4.Two entriesexercise · easy · 10 min · practice plan
Add two separate disclosures.
Passes when: Add two separate disclosures.
5.An FAQ blockexercise · medium · 10 min · practice plan
Build two FAQ entries under a heading.
Passes when: Build two FAQ entries under a heading.
6.Fix the details with no summarybug fix · easy · 8 min
Without a summary there is nothing to click.
Passes when: Without a summary there is nothing to click.
7.Fix the wrong attribute for the open statebug fix · easy · 8 min · practice plan
A disclosure starts expanded with open.
Passes when: A disclosure starts expanded with open.
8.Fix the summary written as a headingbug fix · easy · 8 min · practice plan
The clickable label is a summary element.
Passes when: The clickable label is a summary element.
9.Fix the two entries in one disclosurebug fix · easy · 8 min · practice plan
Each question is its own details element.
Passes when: Each question is its own details element.
10.Fix the missing second questionbug fix · easy · 8 min · practice plan
Only one FAQ entry was written.
Passes when: Only one FAQ entry was written.
Between them these tasks cover Disclosure widgets, summary and open attribute.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.