Skip to content

Commit e6af81e

Browse files
committed
Fix form label/input structure
1 parent b4b6f2f commit e6af81e

1 file changed

Lines changed: 26 additions & 30 deletions

File tree

Form-Controls/index.html

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,25 @@ <h1>Product Pick</h1>
1616
<main>
1717
<form aria-label="T-shirt order form">
1818
<div class="form-group">
19-
<label>
20-
Name
21-
<input
22-
name="customer-name"
23-
type="text"
24-
pattern=".*\S.*\S.*"
25-
title="Please enter at least two non-space characters."
26-
required
27-
/>
28-
</label>
19+
<label for="customer-name">Name</label>
20+
<input
21+
id="customer-name"
22+
name="customer-name"
23+
type="text"
24+
pattern=".*\S.*\S.*"
25+
title="Please enter at least two non-space characters."
26+
required
27+
/>
2928
</div>
3029

3130
<div class="form-group">
32-
<label>
33-
Email
34-
<input
35-
name="customer-email"
36-
type="email"
37-
required
38-
/>
39-
</label>
31+
<label for="customer-email">Email</label>
32+
<input
33+
id="customer-email"
34+
name="customer-email"
35+
type="email"
36+
required
37+
/>
4038
</div>
4139

4240
<fieldset class="form-group">
@@ -60,18 +58,16 @@ <h1>Product Pick</h1>
6058
</fieldset>
6159

6260
<div class="form-group">
63-
<label>
64-
Choose a size
65-
<select name="tshirt-size" required>
66-
<option value="" selected disabled>Select a size</option>
67-
<option value="XS">XS</option>
68-
<option value="S">S</option>
69-
<option value="M">M</option>
70-
<option value="L">L</option>
71-
<option value="XL">XL</option>
72-
<option value="XXL">XXL</option>
73-
</select>
74-
</label>
61+
<label for="tshirt-size">Choose a size</label>
62+
<select id="tshirt-size" name="tshirt-size" required>
63+
<option value="" selected disabled>Select a size</option>
64+
<option value="XS">XS</option>
65+
<option value="S">S</option>
66+
<option value="M">M</option>
67+
<option value="L">L</option>
68+
<option value="XL">XL</option>
69+
<option value="XXL">XXL</option>
70+
</select>
7571
</div>
7672

7773
<button type="submit">Order now</button>

0 commit comments

Comments
 (0)