#Details
- The details element represents a disclosure widget technically called as Accordion.
- It is a container tag.
- It is an inline level element.
- The details tag is used for the content/information which is initially hidden but could be displayed if the user wishes to see it.
#Summary
- The summary element is used to provide caption or title to the details (Accordion).
- It is a container tag.
- It is an inline level element.
- We have to use the summary tag within the details tag.
#Example
-
<details> <summary>New Delhi</summary> It is the capital of India. </details>
-
In the above example, the
<details>
tag creates an Accordion and the <summary>
tag is used to provide title to it. When the user clicks on the summary, the content inside the <details>
tag is shown.