← All Exercises
Build an FAQ with Native details and summary
basichtml
Background
Native details needs no ARIA or JavaScript, and its expanded state and keyboard handling are built into the browser.
Problem
Mark up three FAQ entries as native disclosures where each summary contains a heading and the browser exposes collapsed or expanded state plus Enter and Space toggling.
Input
Three question and answer pairs about copying examples.
Output
A list of details elements with summary headings and answer content.
Sample tests
Sample 1
Input: Screen reader focuses a closed summary
Expected: the summary announces collapsed and reads the heading text as the disclosure label
Sample 2
Input: Keyboard user presses Enter or Space on a summary
Expected: the details element toggles and exposes expanded=true with no custom key handler
Your solution
Learning objective
Use native details and summary so disclosures are keyboard operable and correctly announced without script.