Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

HTML 5 <summary> Tag

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The <summary> tag in HTML is used to define a summary for the <details> element. 

  • The <summary> element is used along with the <details> element and provides a summary visible to the user.
  • When the summary is clicked by the user, the content placed inside the <details> element becomes visible which was previously hidden.
  • The <summary> tag was added in HTML 5.
  • The <summary> tag requires both starting and ending tag.

Note: The <summary> element should be the first child element of the <details> element.

Syntax: 

<summary> Content </summary>

Below program illustrates the <summary> element:
Input :
 

HTML




<!DOCTYPE html>
<html>
<body>
 
<details>
  <!-- html summary tag is used here -->
  <summary>GeeksforGeeks.</summary>
   
 
 
<p> It is a portal for geeks.</p>
 
 
 
</details>
 
</body>
</html>

Output : 
 

Supported Browsers: 

  • Google Chrome 12.0 and above
  • Edge 79 and above
  • Firefox 49.0 and above
  • Opera 15.0 and above
  • Safari 8.0 and above
  • Internet Explorer not supported

 

My Personal Notes arrow_drop_up
Last Updated : 27 Jul, 2022
Like Article
Save Article
Similar Reads
Related Tutorials