HTML DOM Details object

Details object

The Details object represents an HTML <details> element.

Access the Details object

You can access the <details> element with getElementById():

var x = document.getElementById("myDetails");

Try It! 

Create a Details Object

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

var x = document.createElement("DETAILS");

Try It! 

Details object properties

openSets or returns whether the description information within the details tag is displayed.

Standard Properties and Events

Details objects also support standard properties and events .

Related articles

HTML Reference Manual: HTML <details> Tag