<summary>: The HTML Summary Element

1 Description

The HTML <summary> element holds the text which is always visible to the user inside of a <details> element. The <summary> element is always a child of a <details> element. The text which gets displayed to the user when the user clicks on the <summary> element is the text which is inside of the <details> element but NOT inside of the <summary> element.

2 Examples

<!DOCTYPE html>
<html>
    <head>
        <title>Example Page</title>
    </head>
    <body>
        <h1>Summary Example</h1>
        <details>
            <summary>HTML (Hypertext Markup Language)</summary>
            HTML is a markup language designed to encode or 'markup' information
            which may be viewed using a web browser such as Google Chrome or Safari.
        </details>
    </body>
</html>

This document was last updated: