Email or username:

Password:

Forgot your password?
Bramus

Simply add a name attribute with the same value to all participating <details> elements and you're all set ... it's _that_ easy! 🤩

Learn all about it here: developer.chrome.com/docs/css-

I've also included a small polyfill for older browsers in the post.
mas.to/@patrickbrosset/1130903

4 comments
Chris Ferdinandi ⚓️

@bramus Were the accessibility concerns around auto-closing elements that were raised during the spec process ever addressed? I don't see anything about that here.

Ben Keith

@bramus Is there a way to turn the exclusivity off? Many sites will use accordions instead of headings, with the effect that it becomes impossible to search or skim the page without reverting to viewing source.

Bramus

@benlk AFAIK there is no preference to disable this behavior. Seems like a good feature request to make.

In the meantime you could whip up a userscript/extension that removes all the `name` attributes on page load.

FWIW: The feature plays nice with find-in-page. When doing so, the UA will look into the contents of collapsed `<details>` elements. So in that regard it works better than the DIY JS-solutions authors came up with before.

Go Up