-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmodal-content.html
32 lines (29 loc) · 1.08 KB
/
modal-content.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
<div id="modal" script="install Modal">
<div class="modal-underlay"></div>
<div class="modal-content">
<h1 id="title">Accessible Dialog</h1>
<p>
This widget follows the W3C accessibility guidelines for modal dialogs.
</p>
<ul>
<li>Captures focus when first opened</li>
<li>[TAB] toggles between all focusable elements (with 'tabindex' attribute)</li>
<li>[ESC] closes the dialog (as does clicking the underlay)</li>
<li>Automatically adds ARIA roles and labels</li>
</ul>
<form>
<label for="name">
Name:<br>
<input id="name" tabIndex="0" type="text">
</label>
<label for="email">
Email:<br>
<input id="email" tabIndex="0" type="email">
</label>
<div>
<button tabIndex="0">Save</button>
<button tabIndex="0" type="button" script="on click trigger closeModal">Close</button>
</div>
</form>
</div>
</div>