-
Notifications
You must be signed in to change notification settings - Fork 26.7k
/
required-labels.html
37 lines (32 loc) · 1.02 KB
/
required-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
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Required label examples</title>
</head>
<body>
<form>
<p>Required fields are followed by <span aria-label="required">*</span>.</p>
<!-- So this: -->
<!--<div>
<label for="username">Name:</label>
<input type="text" name="username">
<label for="username"><span aria-label="required">*</span></label>
</div>-->
<!-- would be better done like this: -->
<!--<div>
<label for="username">
<span>Name:</span>
<input id="username" type="text" name="username">
<span aria-label="required">*</span>
</label>
</div>-->
<!-- But this is probably best: -->
<div>
<label for="username">Name: <span aria-label="required">*</span></label>
<input id="username" type="text" name="username">
</div>
</form>
</body>
</html>