The <details> tag is used for the content/information which is initially hidden but could be displayed if the user wishes to see it. This tag is used to create an interactive widget that the user can open or close. The content of the details tag is visible when open the set attributes. The summary tag is used with the details tag for specifying visible heading.
<details> <summary> Text content </summary> <div> Content . . . > </details>
details open: The detail tag has an attribute called open which is used to display the hidden information by default.
Example: The below code explains the details tag.
<details open> <summary> Text content </summary> <div> Content . . . > </details>
Example: The below code explains the details open tag in details tag.
- Google Chrome 12.0 and above
- Firefox 49.0 and above
- Opera 15.0 and above
- Safari 6.0 and above