-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialogs.html
42 lines (40 loc) · 1.37 KB
/
dialogs.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./styles.css">
<script src="./dialogs.js" defer></script>
<title>Accessible Component Playground - Dialogs</title>
</head>
<body>
<header>
<nav>
<a href="./home.html">Home</a>
</nav>
</header>
<main>
<h1>Dialogs</h1>
<section>
<h2>Dialog without new HTML dialog element</h2>
<button type="button" id="openModal">Open Modal</button>
</section>
<section>
<h2>Dialog with new HTML dialog element</h2>
<button id="openDialogBtn">Open dialog</button>
<dialog id="dialog" aria-labelledby="dialog-heading">
<h2 id="dialog-heading">This is a heading</h2>
<p>This is some placeholder text within the dialog.</p>
<button type="button" id="cancelDialogBtn">Cancel</button>
</dialog>
</section>
</main>
<!-- This modal dialog sits outside of the main content so that the inert property can be applied when opened-->
<div class="modalBackground hidden"></div>
<div role="dialog" id="modal" aria-labelledby="modal_heading" class="hidden" tabindex="-1">
<h2 id="modal_heading">This is a heading</h2>
<p>This is some placeholder text within the modal.</p>
<button type="button" id="cancelModalBtn">Cancel</button>
</div>
</body>
</html>