Skip to content

Commit

Permalink
add api.HTMLDetailsElement.name page (#35619)
Browse files Browse the repository at this point in the history
  • Loading branch information
dletorey authored Aug 29, 2024
1 parent 6c3bed9 commit 52580e9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions files/en-us/web/api/htmldetailselement/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ The **`HTMLDetailsElement`** interface provides special properties (beyond the r

_Inherits properties from its parent, {{domxref("HTMLElement")}}._

- {{domxref("HTMLDetailsElement.name")}}
- : A string reflecting the [`name`](/en-US/docs/Web/HTML/Element/details#name) HTML attribute, which allows you to create a group of mutually-exclusive {{htmlelement("details")}} elements. Opening one of the named `<details>` elements of this group causes other elements of the group to close.
- {{domxref("HTMLDetailsElement.open")}}
- : A boolean value reflecting the [`open`](/en-US/docs/Web/HTML/Element/details#open) HTML attribute, indicating whether or not the element's contents (not counting the {{HTMLElement("summary")}}) is to be shown to the user.

Expand Down
29 changes: 29 additions & 0 deletions files/en-us/web/api/htmldetailselement/name/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: "HTMLDetailsElement: name property"
short-title: name
slug: Web/API/HTMLDetailsElement/name
page-type: web-api-instance-property
browser-compat: api.HTMLDetailsElement.name
---

{{ APIRef("HTML DOM") }}

The **`name`** property of the {{domxref("HTMLDetailsElement")}} interface reflects the [`name`](/en-US/docs/Web/HTML/Element/details#name) attribute of {{htmlelement("details")}} elements. It enables multiple `<details>` elements to be connected together, where only one for 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

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- The {{htmlelement("details")}} and {{htmlelement("summary")}} elements

0 comments on commit 52580e9

Please sign in to comment.