Details element

Recipe 8.2 Create a native disclosure widget

Sample:

Show details

Detailed content goes here…

Show details

Detailed content goes here…

Code:

<details>
  <summary>Show details</summary>
  
  <p>Detailed content goes here…</p>
</details>

<details open>
  <summary>Show details</summary>
  
  <p>Detailed content goes here…</p>
</details>