HTML | open Attribute

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 than details are not shown.

Note: This attribute is used by <details> element only.

Syntax:



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

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!-- 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>                    

chevron_right


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
  • Internet Explorer Not supported


My Personal Notes arrow_drop_up


If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.