Using the <summary> element:
The <summary> tag defines a visible heading for the <details> element. The heading can be clicked to view/hide the details.
The numbers in the table specify the first browser version that fully supports the element.
Element | |||||
---|---|---|---|---|---|
<summary> | 12.0 | Not supported | Not supported | 6.0 | 15.0 |
The <summary> tag is new in HTML5.
Note: The <summary> element should be the first child element of the <details> element.
The <summary> tag also supports the Global Attributes in HTML.
The <summary> tag also supports the Event Attributes in HTML.
HTML DOM reference: Summary Object
Most browsers will display the <summary> element with the following default values: