Command Palette

Search for a command to run...

Hectal
Phase 2: Structure and Semantics
HTML · Exercise 4 of 6 PreviousNext
Beginner

An FAQ accordion without JavaScript

Turn the three questions and answers into details elements: the question is the summary, the answer follows it.

The first answer should be open when the page loads, the others closed.

Make it an accordion: opening one answer must close the one that's open. Do it with HTML only.

What Check tests

  1. There are three details elements
  2. Each starts with a summary holding the question
  3. The answers are still on the page
  4. Only the first answer is open at the start
  5. Opening another answer closes the first

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.