Three infrequently used HTML elements:<details>, <summary>, <dialog>

Source: Internet
Author: User

Previous words

HTML5 not only added semantic block-level elements and form elements, but also added some other functional elements, which are not widely used due to browser support, for various reasons.

Document description

<details> is used primarily to describe the details of a document or part of a document, and with <summary>, you can define headings for <details>. The title is visible, and when the user clicks on the title, the details are displayed

[note] These two tags are only supported by Chrome and opera

<details>

The label has only one open property to define whether details are visible (default is invisible)

<details>    .</summary>    <p> Blue ideal for small matches </p></details>    

dialog box

The <dialog> tag is used to define a dialog box or window, and the dialog box is positioned horizontally at the center of the window

<details>

The label has only one open property that defines whether the dialog box is visible (default is not visible)

[note] only Chrome and opera support

<button> Show dialog box </button><dialog> I am the content of the dialog box </dialog><script>varOBTN = document.getElementsByTagName ('Button')[0];varOdia = document.getElementsByTagName ('Dialog')[0]; Obtn.onclick=function () {Console.log (Odia.getattribute ('Open'))  if(!odia.getattribute ('Open') {Odia.setattribute ('Open','Open');  This. InnerHTML ='Hide text boxes'; }Else{Odia.removeattribute ('Open');  This. InnerHTML ='Show text Box'; }}</script>

Three infrequently used HTML elements:<details>, <summary>, <dialog>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.