-
Notifications
You must be signed in to change notification settings - Fork 3
/
group_labels.html
88 lines (88 loc) · 3.07 KB
/
group_labels.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
<!doctype html>
<html lang="en">
<head>
<title>Testing Group Labels</title>
</head>
<body>
<p>
Groups of inputs (in particular checkbox and radio button groups) must have a group label. There are multiple ways to achieve this. The one that works with the largets number of ATs is <fieldset> and <legend>, however ARIA can also be used.Below are examples of how to do this markup.
</p>
<a href="#">before</a>
<h2>Fieldset and legend</h2>
<div>
<div>To complete enrollment in Acme, a My Account for the administrator is required.</div>
<div>Consider the <a href="#">administrator's responsibilities</a> for determining the best person for the role.</div>
</div>
<fieldset>
<legend>
Select an Acme Administrator
</legend>
<div>
<div>
<label for="HaveAccountFS">
<input id="HaveAccountFS" name="SignInGroupFS" type="radio" value="HaveMyAccountProfile">
Administrator has a My Account profile.
</label>
</div>
</div>
<div>
<div>
<label for="NeedAccountFS">
<input id="NeedAccountFS" name="SignInGroupFS" type="radio" value="NeedMyAccountProfile">
Administrator needs a My Account profile.
</label>
</div>
</div>
</fieldset>
<a href="#">between</a>
<h2>ARIA radio buttons</h2>
<div role="group" aria-labelledby="selectAdministratorHeaderRight" id="selectAdministratorRight">
<div>
<h3 id="selectAdministratorHeaderRight">Select an Acme Administrator</h3>
</div>
<div>
<div>To complete enrollment in Acme, a My Account for the administrator is required.</div>
<div>Consider the <a href="#">administrator's responsibilities</a> for determining the best person for the role.</div>
</div>
<div>
<div>
<input id="HaveAccountRight" name="SignInGroupRight" type="radio" value="HaveMyAccountProfile" aria-labelledby="HaveAccountRightLabel selectAdministratorHeaderRight">
<label id="HaveAccountRightLabel">Administrator has a My Account profile.</label>
</div>
</div>
<div>
<div>
<input id="NeedAccountRight" name="SignInGroupRight" type="radio" value="NeedMyAccountProfile" aria-labelledby="NeedAccountRightLabel selectAdministratorHeaderRight">
<label id="NeedAccountRightLabel">Administrator needs a My Account profile.</label>
</div>
</div>
</div>
<a href="#">between</a>
<h2>ARIA Checkboxes</h2>
<div role="group" aria-labelledby="foodHeader" id="food">
<div>
<h3 id="foodHeader">What food does your Admin eat?</h3>
</div>
<div>
<div>Admins spend a bunch of time, late at night, doing admin-y things. Send them some food!!</div>
</div>
<div>
<div>
<label>
<input id="pizza" name="pizza" type="checkbox" aria-labelledby="foodHeader pizzaLabel">
<span id="pizzaLabel">Pizza</span>
</label>
</div>
</div>
<div>
<div>
<label>
<input id="pasta" name="pasta" type="checkbox" aria-labelledby="foodHeader pastaLabel">
<span id="pastaLabel">Pasta</span>
</label>
</div>
</div>
</div>
<a href="#">after</a>
</body>
</html>