Using the details element, we can build an HTML accordion in just four lines of code. By default, the <details> element loads in a closed state. We can load the accordion open by default by adding the open attribute to the < details> element.

2 Comments
Sort: