Please check the below example:
<details>
<summary>Man</summary>
<p>Man is a good creature.</p>
</details>
Here summary is the topic, when you click it in browser, it expands and you find the hidden message "Man is a good creature." I love this two elements, very useful in writing FAQs for your website, in question-answer form. When reader click on a question, and it comes the answer.
If you don't want to hide the message, use "open" attribute, like the following example.
<details open>
<summary>Man</summary>
<p>Man is a good creature.</p>
</details>
Though the hidden message is open, but readers can hide it again by clicking on <summary> that is "Man" here.
See in your browser and understand the difference.
Comments
Post a Comment