
The HTML <details> tag defines additional information that the user can open and close on demand.
Note: The HTML <summary> element is used in conjunction with the <details> tag to define a visible heading for the information.
Example:
<!DOCTYPE html>
<html>
<body>
<details>
<summary>HTML</summary>
<p>HTML defines the structure of the web page.</p>
</details>
</body>
</html>
Output:
HTML
HTML defines the structure of the web page.
Attributes:
open – defines that the details/ information should be visible to the user.
Read also:
HTML Select, Option and Optgroup tags