Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I use <details> a lot for debugging Go html templates.

    {{if .DevMode}}
    <details>
    <summary>Data</summary>
    {{.}}
    </details>
    {{end}}

It's nicely unobtrusive when collapsed, doesn't mess up the page completely. Then expands to the full glory when needed.


I abuse the <details> element when I can. It's so neat, I don't know why it's not used more often.


You can use it for all sorts of things on web pages, including collapsible menues and such.

Github markdown lets you use it too. People use it for examples and inline explanations.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: