HTMLDetailsElement

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

The HTMLDetailsElement interface provides special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating <details> elements.

EventTarget Node Element HTMLElement HTMLDetailsElement

Instance properties

Inherits properties from its parent, HTMLElement.

HTMLDetailsElement.name

A string reflecting the name HTML attribute, which allows you to create a group of mutually-exclusive <details> elements. Opening one of the named <details> elements of this group causes other elements of the group to close.

HTMLDetailsElement.open

A boolean value reflecting the open HTML attribute, indicating whether or not the element's contents (not counting the <summary>) is to be shown to the user.

Instance methods

No specific method; inherits methods from its parent, HTMLElement.

Events

Listen to this event using addEventListener() or by assigning an event listener to the oneventname property of this interface.

toggle

Fired when the open/closed state of a <details> element is toggled.

Specifications

Specification
HTML Standard
# htmldetailselement

Browser compatibility

BCD tables only load in the browser

See also

  • The HTML element implementing this interface: <details>