HTML open Attribute


The open attribute in HTML is a Boolean attribute used primarily with the <details> element to indicate that the contents should be visible by default. When a <details> element includes the open attribute, it means that the detailed information contained within it, usually wrapped by a <summary> tag for the title or heading, is displayed to the user from the start. Without the open attribute, the content is hidden and only shown when the user activates the <summary> element, typically by clicking on it.

In essence, the open attribute controls the initial display state of the additional information that <details> encompasses. Its presence (with or without a value, since it's a Boolean attribute) means the details are expanded, and its absence means they are collapsed. This attribute enhances web pages by allowing for the efficient organization of content, making it more user-friendly by showing or hiding details as needed or as preferred by the web designer.


<details open>


The open attribute is a boolean attribute, therefore no values are associated with this attribute.

Applies To

The open attribute can be used on the following html elements.


<details open>
<summary>This is a summary</summary>
<p>Here are some details that will be visible by default because the open attribute is present.</p>

<summary>This is another summary</summary>
<p>Here are some details that will be hidden by default because the open attribute is not present.</p>

Browser Support

The following table will show you the current browser support for the HTML open Attribute.

Edge Chrome Firefox Opera Safari
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview

Last updated by CSSPortal on: 29th March 2024