The HTML open attribute define the details HTML element content should be visible(open) in an HTML document.
Syntax
Following is the syntax −
<details open></details>
Let us see an example of HTML open Attribute −
Example
<!DOCTYPE html>
<html>
<style>
body {
color: #000;
height: 100vh;
background-color: #8BC6EC;
background-image: linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%);
text-align: center;
}
</style>
<body>
<h1>HTML low Attribute Demo</h1>
<details open>
<summary>Hi! I'm a summary element</summary>
<p>Hi! I'm a paragraph element with some dummy text</p>
</details>
</body>
</html>Output
