Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

details — disclosure widget

The `details` element reveals additional information when expanded. Its `summary` supplies the label, while the `open` attribute determines whether the content is expanded.

Version: WHATWG HTML Living Standard; index snapshot date recorded separately

Syntax

<details><summary>Label</summary><p>Additional information.</p></details>

details is a native disclosure widget for information or additional controls. Place one summary as its first child, followed by the content. Both details tags are required. Do not use this element instead of tabs, menus, or footnotes.

Without open, only the label is visible. This boolean attribute's presence also shows the content; open="false" does not collapse the section and is an invalid boolean attribute value. Remove the attribute to collapse it. Basic interaction requires no JavaScript.

A shared, nonempty name groups elements in the same tree: opening one closes the others. Do not mark multiple group members as open or nest members inside each other. Use this exclusivity only when users do not need to compare several expanded sections.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Disclosure example</title>
<details>
  <summary>File information</summary>
  <p>Format: TXT</p>
</details>
</html>

Result

Initially: File information
After opening: File information
Format: TXT
After closing: File information

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources