html tutorial - open Attribute in HTML - html5 - html code - html form



Open attribute in html

Learn html - html tutorial - Open attribute in html - html examples - html programs

  • The open attribute defines when the user can view the details of the elements by default.
  • The open attribute is a Boolean attribute.

Syntax for open attribute in HTML:

<details open>

Differences between HTML 4.01 and HTML5 for open attribute:

HTML 4.01

  • The open attribute does not support in HTML4.

HTML 5

  • The open attribute added newly in HTML 5.

Applies To:

Element Attribute
<details> open

Sample Coding for open Attribute in HTML:

Tryit<!DOCTYPE html>
<html>
   <body>
     <details open>
     <summary>Wikitechy</summary>
     <p>Tutorials</p>
     <p>Articles</p>
     <p>Error and Fixes</p>
     <p>Interview tips</p>
     </details>
  </body>
</html>

Code Explanation for open Attribute in HTML:

open Attribute Code Explanation

  1. The <details> element describes the additional details that the user can toggle show or hide.
  2. open attribute specify the details should be visible by default.
  3. summary tag specifies a visible heading, which may be clicked to view/hide the details.

Output for open Attribute in HTML:

open Attribute Tag Output

  1. We can see the details list of the Wikitechy which is open by default.

Browser Support for open Attribute in HTML:

Yes No No Yes Yes

Related Searches to open Attribute in html