CKTIS / HTML
summary — disclosure section label
The `summary` element describes a `details` section and lets users expand or collapse it without JavaScript.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
<details>
<summary>Label</summary>
<p>Additional information.</p>
</details>Place summary as the first child of details. It labels the remaining content. Only the first summary child performs this function.
Activation toggles the parent details element's open attribute, not an attribute on summary. Without open, only the label is visible; with it, the additional content is visible too. Writing open="false" still makes the attribute present, so the section is open.
The content of summary can be phrasing content, optionally intermixed with headings. Both tags are required. The element supports global attributes and uses HTMLElement; it is not a standalone general-purpose button.
Examples
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Summary example</title>
</head>
<body>
<details>
<summary>Answer</summary>
<p>42</p>
</details>
</body>
</html>Result
Initially: Answer After activating Answer: Answer and 42 After activating Answer again: Answer
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.