3 ms·
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details https://developer.mozilla.org/en-US/docs/Web/HTML/Element/de... <details> is completely suppo
by 6510 3y ago
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details https://developer.mozilla.org/en-US/docs/Web/HTML/Element/de...
<details> is completely supported.
- toast0 3y agoOooh, that's lovely. I have a page with ~50 lines of javascript to do this, and it looks like I can make it zero lines of javascript instead.
- 6510 3y agoOne could use js to push the state into the url.
- toast0 3y agoIt's just opening and closing detail panes (personal recipie site), there's no reason to put the open/closed state in the url. But if I can do it with all html, that's better than a function to add / remove a css class and document.onclick = a function to find which recipie you clicked on and adjust the css class.
- 6510 3y agoProbably more useful for a nested menu. The default thing almost works out of the box. You need some css to set a proper cursor and style the clickable text properly.