Details and Summary
The <details> element creates a disclosure widget. <summary> provides the visible control used to open and close it. These elements provide native behavior without requiring JavaScript for basic disclosure interactions.
Native Disclosure
<details>\n <summary>What is HTML?</summary>\n <p>HTML is the standard markup language for web documents.</p>\n</details>💡 The browser provides the basic expand and collapse interaction.
Key Takeaways
- details provides native disclosure behavior.
- summary defines the visible disclosure label.
Knowledge Check
Which element provides the label for a details disclosure?