YouTip LogoYouTip

Prop Details Open

HTML DOM Details open Property

HTML DOM Details open Property

-- Learning is not just about technology, but also about dreams!

JavaScript Reference

Overview

JavaScript Objects

JavaScript Array Object JavaScript Boolean Object JavaScript Date Object JavaScript Math Object JavaScript Number Object JavaScript String Object JavaScript RegExp Object JavaScript Global Properties/Functions JavaScript Operators JavaScript Error

Browser Objects

Window Object Navigator Object Screen Object History Object Location Object Storage Object

DOM Objects

HTML DOM Document Object HTML DOM Element Object HTML DOM Attribute Object HTML DOM Event Object HTML DOM Console Object CSSStyleDeclaration Object DOM HTMLCollection

HTML Objects

<a> <area> <audio> <base> <blockquote> <body> <button> <canvas> <col> <colgroup> <datalist> <del> <details> <dialog> <embed> <fieldset> <form> <iframe> <frameset > <img> <ins> <input> - button <input> - checkbox <input> - color <input> - date <input> - datetime <input> - datetime-local <input> - email <input> - file <input> - hidden <input> - image <input> - month <input> - number <input> - range <input> - password <input> - radio <input> - reset <input> - search <input> - submit <input> - text <input> - time <input> - url <input> - week <keygen> <link> <label> <legend> <li> <map> <menu> <menuItem> <meta> <meter> <object> <ol> <optgroup> <option> <param> <progress> <q> <script> <select> <source> <style> <table> <td> <th> <tr> <textarea> <title> <time> <track> <video>

HTML DOM Title Object

HTML DOM Details Object

Details open Property

Details Object Reference Details Object

Example

Show extra description information:

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

Try it yourself Β»


Definition and Usage

The open property is used to set or return whether the information inside the details tag is displayed (open) to the user.

This property reflects the HTML open attribute.

When set to true, the content information inside the details tag will be visible.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

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


Syntax

Get the open property:

detailsObject.open

Set the open property:

detailsObject.open=true|false

Property Values

Value Description
true|false Specifies whether the details should be visible on the HTML page.
* true - The description information is visible.
* false - The description information is not visible.

Technical Details

Return Value: A Boolean. Returns true if the details tag content is visible, otherwise returns false.

More Examples

Example

Check if the extra information in the details tag is visible:

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

The x output result is:

true

Try it yourself Β»

Example

Show or hide extra description information:

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

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

Try it yourself Β»


Details Object Reference Details Object

← Dom Obj EmbedDom Obj Details β†’