logoalt Hacker News

rhdunnyesterday at 7:01 AM2 repliesview on HN

If you specify the same name on each `details` element they behave like an accordion automatically [1], no need for JavaScript. If you set one of them to open that one will be initially open.

[1] https://developer.mozilla.org/en-US/blog/html-details-exclus...


Replies

crooked-vyesterday at 8:00 AM

It's not about using it as an accordion, it's about controlling the open/closed state from other interactions.

6510yesterday at 1:38 PM

different things with the same name? O_O

show 1 reply