W3Schools.com
THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPJQUERYBOOTSTRAPANGULARXML
 

Details open Property

Details Object Reference Details Object

Example

Show additional details:

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

Try it yourself »

Definition and Usage

The open property sets or returns whether additional details/information should be visible (open) to the user, or not.

This property reflects the HTML open attribute.

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


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The open property is currently only supported in Opera, Chrome and Safari 6.


Syntax

Return the open property:

detailsObject.open

Set the open property:

detailsObject.open=true|false

Property Values

Value Description
true|false Specifies whether additional details should be visible (open) to the user, or not
  • true - Details will be visible
  • false - Details will not be visible

Technical Details

Return Value: A Boolean, returns true if the details are visible, otherwise it returns false

More Examples

Example

Find out if additional details are visible (open) to the user, or not:

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

The result of x could be:

true

Try it yourself »

Example

Toggle between opening and closing the additional details:

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

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

Try it yourself »

Details Object Reference Details Object