A long FAQ is easier to scan when visitors can see the questions at a glance. HTML's <details> and <summary> elements let visitors reveal an answer by expanding its question.
The browser makes the summary a focusable control and supplies a triangle that shows whether the disclosure is open. Visitors can toggle it with a click or a key press, without JavaScript.
Information that everyone needs, such as a registration deadline, belongs in the main page where it's visible from the start.
Steps to use details and summary in HTML:
- Save a blank file named workshop-faq.html in a new workshop test folder using your text editor.
- Insert the disclosure just before the closing </body> tag.
<details> <summary>What should I bring?</summary> <p>Bring a notebook and a pen.</p> </details>
The <summary> comes first inside <details> and supplies the question visitors select. The paragraph holds the answer. With no open attribute on <details>, the answer starts hidden.
- Save workshop-faq.html.
- Open the saved workshop-faq.html file in desktop Chrome.
In Chrome's address bar, the local file address starts with file:/// and includes the folder where you saved the file.
- Press Tab to focus the workshop question.
A focus outline appears around What should I bring? with the triangle still pointing right.
- Press Enter on the focused question to expand the disclosure.
The triangle points down and the answer Bring a notebook and a pen. appears below the question.
- Press Space on the still-focused question to hide the answer.

- Verify that the question remains visible with the answer hidden again.
The triangle points right again. If the answer never appeared after Enter or remains visible after Space, the keyboard check failed.