HTML DOM Details Object

Details Object

The Details object represents an HTML <details> element.

注: The <details> element is currently only supported in Chrome, Safari 6+ and Opera 15+.

Access a Details Object

You can access a <details> element by using getElementById():


var x = document.getElementById("myDetails");
Try it Yourself »

Create a Details Object

You can create a <details> element by using the document.createElement() method:


var x = document.createElement("DETAILS");
Try it Yourself »

Details Object Properties

Property 説明
open Sets or returns whether the details should be visible (open) to the user, or not

Standard Properties and Events

The Details object also supports the standard properties and events.

Related Pages

HTML reference: HTML <details> tag

HTML reference: HTML <summary> tag

JavaScript reference: HTML DOM Details Object