The <summary> tag marks a visible heading for the <details> element.
We can click heading to view/hide the details.
<summary> |
Yes | No | No | Yes | Yes |
The <summary> tag is new in HTML5.
The <summary> tag supports the Global Attributes in HTML.
The <summary> tag supports the Event Attributes in HTML.
summary { display: block; }
<!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>