This website uses cookies

We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you've provided to them or that they've collected from your use of their services. Please read more at our privacy policy page.



HTML <summary> Tag

The <summary> tag is used to define the visible header for the <details> element. By clicking on the header the user can view/hide the information.

The <summary> element always should be the first element inside <details> tag.

The <summary> tag is new to HTML5.

Syntax

The content of the tag is between the opening (<summary>) and closing (</summary>) tag.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    <details>
      <summary>Copyright 2013-2014.</summary>
      <p> W3docs. All rights reserved.</p>
      <p>The content of the website is the property of W3Docs.com.</p>
    </details>
  </body>
</html>

Result

Attributes

The <summary> tag supports Global Attributes and the Event Attributes.

Browser support

12+ 49+ 6+ 15+