A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/html/html-details-open-attribute/ below:

HTML | <details> open Attribute

HTML | <details> open Attribute

Last Updated : 21 Jul, 2022

The HTML <details> open attribute is used to indicate whether the details will be display on page load. It is a boolean attribute. If this attribute is present then the detail will be visible. 

Syntax:

<details open> Contents... </details>

Example: This example illustrates the use of open attribute in <details> element. 

html
<!-- HTML program to illustrate details open Attribute -->

<!DOCTYPE html> 
<html> 
    <head> 
        <title>HTML details open Attribute</title> 
    </head> 
    
    <body> 
        <h1 style="text-align:center;">
            GeeksForGeeks
        </h1>
        
        <h2 style = "color: green; text-align: center;"> 
            HTML &lt;Details&gt;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:

  

Supported Browsers: The browser supported by HTML <details> open attribute are listed below:



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4