-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathfieldset-radio-group-aria.html
100 lines (97 loc) · 4.58 KB
/
fieldset-radio-group-aria.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Radio group using role="group"</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="favicon.ico">
<link href="assets/css/examples.css" rel="stylesheet">
</head>
<body>
<h1>Radio group using <code>role="group"</code></h1>
<p>← <a href="index.html">Return to main list</a></p>
<p>This is a test case designed to determine how the <a href="https://html.spec.whatwg.org/multipage/form-elements.html#the-fieldset-element" target="_blank"><code><fieldset></code></a> and <a href="https://html.spec.whatwg.org/multipage/form-elements.html#the-legend-element" target="_blank"><code><legend></code></a> elements are announced in relation to a radio group by various screen readers. In this test, the radio group is not presented inside a list.</p>
<h2>Example</h2>
<form action="#">
<div role="group" aria-describedby="group-heading1">
<h3 id="group-heading1">Do you like boats?</h3>
<div class="form-group">
<input type="checkbox" id="boats-y">
<label for="boats-y">Yes</label>
</div>
<div class="form-group">
<input type="checkbox" id="boats-n">
<label for="boats-n">No</label>
</div>
</div>
</form>
<form action="#">
<div role="radiogroup" aria-describedby="group-heading2">
<h3 id="group-heading2">Do you like apples?</h3>
<div class="form-group">
<input type="radio" id="apples-y" name="apples">
<label for="apples-y">Yes</label>
</div>
<div class="form-group">
<input type="radio" id="apples-n" name="apples">
<label for="apples-n">No</label>
</div>
</div>
</form>
<h2>Code</h2>
<!-- start code -->
<pre><code><form action="#">
<div role="group" aria-describedby="group-heading1">
<h3 id="group-heading1">Do you like boats?</h3>
<div class="form-group">
<input type="checkbox" id="boats-y">
<label for="boats-y">Yes</label>
</div>
<div class="form-group">
<input type="checkbox" id="boats-n">
<label for="boats-n">No</label>
</div>
</div>
</form>
<form action="#">
<div role="radiogroup" aria-describedby="group-heading2">
<h3 id="group-heading2">Do you like apples?</h3>
<div class="form-group">
<input type="radio" id="apples-y" name="apples">
<label for="apples-y">Yes</label>
</div>
<div class="form-group">
<input type="radio" id="apples-n" name="apples">
<label for="apples-n">No</label>
</div>
</div>
</form></code></pre>
<!-- end code -->
<h2>Assistive technologies</h2>
<div class="note">
<h3>VoiceOver</h3>
<ul class="browser-list">
<li><b>Chrome:</b> Yes. Radio button. 1 of 2. <span class="green">Do you like boats?</span> <span class="green">Group</span>.</li>
<li><b>Firefox:</b> Yes. Radio button. 1 of 2. <span class="green">Do you like boats?</span> <span class="green">Group</span>.</li>
<li><b>Safari:</b> Yes. Radio button. 1 of 2. <span class="red">Do you like boats?</span> <span class="green">Do you like boats?</span> <span class="green">Group</span>. <span class="red">[Legend announced twice]</span></li>
</ul>
</div>
<div class="note">
<h3>NVDA</h3>
<ul class="browser-list">
<li><b>Chrome:</b> <span class="green">Do you like boats?</span> <span class="green">Grouping</span>. Yes. Radio button. Not checked. 1 of 2.</li>
<li><b>Firefox:</b> <span class="green">Do you like boats?</span> <span class="green">Grouping</span>. Yes. Radio button. Not checked. 1 of 2.</li>
<li><b>Edge:</b> <span class="green">Do you like boats?</span> <span class="green">Grouping</span>. Yes. Radio button. Not checked. 1 of 2.</li>
</ul>
</div>
<div class="note">
<h3>JAWS</h3>
<ul class="browser-list">
<li><b>Chrome:</b> <span class="green">Do you like boats?</span> <span class="green">Group</span>. Yes. Radio button. Not checked. 1 of 2.</li>
<li><b>Firefox:</b> To change the selection use the up or down arrow. <span class="green">Do you like boats?</span> Yes. Radio button. Not checked. Yes. Radio button. Not checked. 1 of 2.</li>
<li><b>Edge:</b> <span class="green">Do you like boats?</span> <span class="green">Group</span>. Yes. Radio button. Not checked. 1 of 2.</li>
</ul>
</div>
<p>← <a href="index.html">Return to main list</a></p>
</body>
</html>