HTML Accordions

Using the HTML Details element (<details>) is an easy way to add an accordion to a site. It’s built-in, well-supported, and easy to use.

<details>
  <summary>A frequently-asked question</summary>
  The expandable answer to that question, which can include any flow content.
</details>

You can even track events on the Details element.

CCS-Tricks has a good article on styling the Details element.

Source