Interactive Elements
HTML <summary> element
Supplies the visible label for a details disclosure. Put it first inside the details element. Use a short, informative label so users know what will be revealed. Native keyboard activation is available; avoid nesting unrelated interactive controls inside it. It accepts global HTML attributes; individual global features may be inapplicable or restricted.
Formal Syntax & Structure
html syntaxhtml
<summary>Label</summary>Return Value
HTMLElement
Content model: Phrasing content, or a heading, under details.
Working Example
Example Snippethtml
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <title>HTML example</title> </head> <body> <details> <summary>Shipping</summary> <p>Delivery takes two days.</p> </details> </body></html>