GO-V.ORG
As seen in

HTMLDetailsElement: name property

HTML DOM

HTML DOM

The **`name`** property of the HTMLDetailsElement interface reflects the [`name`](/docs/Web/HTML/Reference/Elements/details#name) attribute of details elements. It enables multiple `<details>` elements to be connected together, where only one of the `<details>` elements can be open at once. This allows developers to easily create UI features such as accordions without scripting.

The name attribute specifies a group name — give multiple `<details>` elements the same name value to group them. Only one of the grouped `<details>` elements can be open at a time — opening one will cause another to close. If multiple grouped `<details>` elements are given the `open` attribute, only the first one in the source order will be rendered open.

## Value

A string. The empty string if the element is not part of any group.

## Specifications

## Browser compatibility

## See also

- The details and summary elements

source: MDN Web Docs mirror · page

Cite this

"HTMLDetailsElement: name property". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/HTMLDetailsElement/name

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·