Horje
HTML open Attribute

Definition and Usage

The open attribute is a boolean attribute.

When present, it specifies that the details should be visible (open) by default.


Applies to

The open attribute can be used on the following element:

Element Attribute
<details> open

Browser Support

The numbers in the table specify the first browser version that fully supports the attribute.


How to use An open/visible <details> element - HTML open Attribute

This example demonstrates a details element that is open by default.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The details open attribute</h1>

<details open>
  <summary>Epcot Center</summary>
  <p>Epcot is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks and seasonal special events.</p>
</details>

<p>This example demonstrates a details element that is open by default.</p>

</body>
</html>

Output should be:

How to use An open/visible <details> element - HTML open Attribute




html open attribute

Type:
Develop
Category:
Web Tutorial
Sub Category:
HTML Attribute
Uploaded by:
Admin


Read Article
https://develop.horje.com/learn/1434/reference