HTML Tag Reference - HTML tag <summary>








The <summary> tag marks a visible heading for the <details> element.

We can click heading to view/hide the details.

Browser compatibility

<summary> Yes No No Yes Yes

What's new in HTML5

The <summary> tag is new in HTML5.

Global Attributes

The <summary> tag supports the Global Attributes in HTML.

Event Attributes

The <summary> tag supports the Event Attributes in HTML.

Default CSS Settings

summary {
    display: block;
}




Example

<!DOCTYPE html>
<html>
<body>
<!--from  ww w  .  ja va2 s . c  om-->
    <details>
    <summary>Heading</summary>
    <p>content.</p>
    <p>content.</p>
    <p>content.</p>
    <p>content.</p>
    <p>content.</p>
    <p>content.</p>
    <p>content.</p>
    </details>

</body>
</html>

Click to view the demo