← BYTES
HTML·Intermediate·Ref: 2.2.18
What do the `<details>` and `<summary>` elements provide, without requiring any JavaScript?
Have a question about this video? Mention reference 2.2.18 when you contact us.
a.A styled table of contents generated automatically from page headings
b.A deprecated HTML4 feature with no modern browser support
c.A way to embed external website previews inline
d.A native, built-in collapsible disclosure widget: `<summary>` is the always-visible clickable label, and the rest of `<details>`'s content is hidden by default and toggled open/closed by clicking it, including built-in keyboard accessibility
<details><summary>Click to expand</summary>Hidden content</details> gives you a fully functional, keyboard-accessible expand/collapse widget with zero JavaScript or ARIA attributes needed -- the browser handles the open/closed state, the toggle interaction, and announces it correctly to screen readers natively.
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES2218#HTML