CodeOath
← All challenges

Accordion / FAQ Toggle

Easy
javascriptdomaccessibility

Build a simple FAQ accordion — a list of questions where clicking one expands its answer, and clicking it again collapses it. At least 3 questions.

Decide for yourself whether opening one question should close the others (both are valid accordion behaviors — just be consistent).

Check your work against

  • At least 3 question/answer pairs
  • Clicking a question toggles its answer open/closed
  • Some visual indicator (an arrow/chevron/plus-minus) shows open vs. closed state
  • Works with more than one click in a row without getting stuck

There's no automated grading for UI challenges — self-check against this list, then compare with the solution preview.

Live preview