HTML details tag

<details> tag in HTML

The <details> tag represents a piece of hidden content that can be shown upon user request.

It is represented by collapsible content, accompanied by an arrow that suggests the user that more content can be accessed.

When the user clicks the arrow, the content is automatically displayed.

<summary> tag can be used with it, to denote a title for the contents.

Example 1

Try Yourself

Example 2

Try Yourself

open attribute in <details> tag

Default value is false.

If the value is true or the attribute is present, the details will be shown(open).


Try Yourself