Details and Summary
The <details> and <summary> elements create a native accordion without JavaScript. The browser handles the open/close toggle.
The <details> and <summary> elements create a native accordion without JavaScript. The browser handles the open/close toggle.
<details>
<summary>What is HTML5?</summary>
<p>HTML5 is the fifth revision of the HTML standard, introducing
new semantic elements, form controls, APIs, and multimedia support.</p>
</details>
<details open>
<summary>Getting Started</summary>
<ol>
<li>Install a text editor</li>
<li>Create an index.html file</li>
<li>Open it in a browser</li>
</ol>
</details>
Add the "open" attribute to have a details element expanded by default.