Details open property
Example
Show additional description information:
document.getElementById("myDetails").open=true;
Try it »
Definition and Usage
The open property is used to set or return whether the information inside the details tag is visible to the user (open).
This property reflects the HTML open attribute.
When set to true, the content inside the details tag will be visible.
Browser support





The open property is currently only supported by Opera, Chrome and Safari 6 browsers.
Syntax
Return the open property:
detailsObject
.open
Set the open property:
detailsObject
.open=true|false
Attribute values
| Value | Description |
|---|---|
| true|false | Specifies that the details should be visible on the HTML page.
|
Technical Details
| Return Value: | Boolean, returns true if the content of the details tag is visible, otherwise returns false. |
|---|
More examples
Example
Check whether the additional information in the details tag is visible:
var x = document.getElementById("myDetails").disabled;
x The output result is:
true
Try it »
Example
Show or hide additional description information:
function openDetails()
{
document.getElementById("myDetails").open=true;
}
function closeDetails()
{
document.getElementById("myDetails").open=false;
}
Try it »
Details Object