HTML summary Tag

HTML <summary>Tag: The HTML<summary> tag specifies a visible heading for the <details> element. And 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.

HTML <summary>Tag

This HTML summary tag supports both the global and the event attributes. It was added in HTML 5. And also requires both starting and ending tag.

Syntax: <summary> Text </summary>

Browser compatibility

The HTML<summary> tag is supported by different types of browsers.

  • Chrome
  • Firefox
  • Opera
  • Safari
  • Internet Explorer

Example:

<!DOCTYPE html>
<html>
<body>
<details>
  <summary>Copyright © 2019, </summary>
  <p> FreshersNow.Com. Made with ❤ in India</p>
</details>
</body>
</html>

Output:

html summary tag