<details>
<details>
Tag
A disclosure widget typically features a rotating triangle to indicate its open or closed status, along with a label from the <summary>
element. The <details>
element provides an accessible description for the <summary>
.
Syntax
<details>
<summary>Summary or Heading</summary>
Detailed information that is hidden until the user clicks to reveal it.
</details>
<details>
Demo
Details
Something small enough to escape casual notice.<details>
<summary>Details</summary>
Something small enough to escape casual notice.
</details>
<summary>
tag serves as a clickable heading or label for the details section.
The content inside the <details>
tag is hidden by default and becomes visible when the user clicks the summary.Attributes
This element includes the global attributes.
open
A Boolean attribute that indicates whether the content of the<details>
element is visible. It is displayed when present and hidden by default when absent.name
This attribute allows multiple<details>
elements to be linked, ensuring that only one is open at a time. This feature facilitates the creation of UI elements like accordions without the need for scripting.
Conclusion
The <details>
tag in HTML provides an interactive way to hide or reveal content, enhancing user experience. It works with the <summary>
tag, which acts as a clickable heading for the hidden content. The open
attribute controls whether the content is visible by default, and the name
attribute helps link multiple <details>
elements.
<datalist>
The HTML <datalist> element offers a set of predefined options for an <input> element, providing suggestions as users type to improve form usability and validation.
<dialog>
The HTML <dialog> element creates a dialog box or popup, offering a consistent method for implementing interactive modal or non-modal windows with built-in opening and closing functionality.