HTML <details> open Attribute

The open attribute on a <details> tag opens the details element on page load and reveals its content.

Example

#

An open attribute on a <details> element.
The content of the <details> element is visible when the page is loaded.

Cities in Europe

Rome

Athens

Madrid

<details open>
  <summary>Cities in Europe</summary>
  <p>Rome</p>
  <p>Athens</p>
  <p>Madrid</p>
</details>

Using open

The open attribute specifies that the content of the <details> element is visible on page load.

By default, the content in a <details> element is hidden (closed).


Syntax

<details open>

Browser support

Here is when open support started for each browser:

Chrome
12.0 Jun 2011
Firefox
49.0 Sep 2016
IE/Edge
79.0 Jan 2020
Opera
15.0 May 2013
Safari
6.0 Jul 2012

You may also like

 Back to <details>
Guides