Details open attribute

Definition and usage

open whether the additional detailed/information should be visible to the user (open) or not.

This attribute reflects details open attribute.

When set to true, detailed information will be visible to the user (open).

See also:

HTML-Referenzhandbuch:HTML <details>-Tag

Example

Example 1

Display additional detailed information:

document.getElementById("myDetails").open = true;

Try it yourself

Example 2

Understand whether the user can see (open) additional detailed information:

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

Try it yourself

Example 2

Toggle between opening and closing additional detailed information:

function openDetails() {
    document.getElementById("myDetails").open = true;
}
function closeDetails() {
    document.getElementById("myDetails").open = false;
}

Try it yourself

Syntax

Return the open attribute:

detailsObject.open

Set the open attribute:

detailsObject.open = true|false

Attribute value

Value Description
true|false

Specify whether additional detailed information should be visible to the user (open).

  • true - Detailed information will be visible
  • false - Detailed information will not be visible

Technische Details

Rückgabewert: Boolscher Wert, gibt true zurück, wenn die Details sichtbar sind, sonst false.

Browser-Unterstützung

Die in der Tabelle angegebenen Zahlen beziehen sich auf die erste Version des Browsers, die diese Eigenschaft vollständig unterstützt.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
12.0 Nicht unterstützt 49.0 6.0 15.0

Verwandte Seiten

HTML-Referenzhandbuch:HTML <details> open-Eigenschaft