Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <details> open Attribute

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

By default, <details> are closed and not visible.

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>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides