Open In App

HTML open Attribute

Last Updated : 02 Aug, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The open attribute in HTML is used to indicate whether the details will be shown on page load. This is a boolean attribute. If it is not present by default then details are not shown.

Note: This attribute is used by <details> element only. This attribute has been DEPRECATED and is no longer recommended.

Applicable:

Syntax:

<details open> content... </details>

Example: 

html




<!-- HTML program to illustrate open Attribute -->
 
<!DOCTYPE html>
<html>
 
<head>
    <title>HTML open Attribute</title>
</head>
 
<body>
    <h2 style="color: green; text-align: center;">
        HTML open Attribute
    </h2>
 
    <!-- Below details tag has "open" attribute -->
    <details open>
        <summary>Geeks classes</summary>
 
        <p>
            An extensive classroom programme to build
            and enhance Data Structures and Algorithm
            concepts.
        </p>
 
    </details>
</body>
 
</html>


Output: 

open

Supported Browsers: The browser supported by open attribute are listed below: 

  • Apple Safari 6.0
  • Google Chrome 12.0
  • Firefox Not supported
  • Opera 15.0

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads