-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(html): provide corresponding 'id's for 'for' attributes on <label…
…> tags (#2678)
- Loading branch information
1 parent
e225993
commit 49a3dca
Showing
26 changed files
with
67 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<form> | ||
<label for="name">Name:</label> | ||
<input name="name" type="text" /> | ||
<input id="name" name="name" type="text" /> | ||
|
||
<label for="emp">Employed:</label> | ||
<select name="emp" disabled> | ||
<select id="emp" name="emp" disabled> | ||
<option>No</option> | ||
<option>Yes</option> | ||
</select> | ||
|
||
<label for="empDate">Employment Date:</label> | ||
<input name="empDate" type="date" disabled /> | ||
<input id="empDate" name="empDate" type="date" disabled /> | ||
|
||
<label for="resume">Resume:</label> | ||
<input name="resume" type="file" /> | ||
<input id="resume" name="resume" type="file" /> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<form> | ||
<label for="name">Name:</label> | ||
<input name="name" type="text" /> | ||
<input id="name" name="name" type="text" /> | ||
|
||
<label for="emp">Employed:</label> | ||
<select name="emp" disabled> | ||
<select id="emp" name="emp" disabled> | ||
<option>No</option> | ||
<option>Yes</option> | ||
</select> | ||
|
||
<label for="empDate">Employment Date:</label> | ||
<input name="empDate" type="date" disabled /> | ||
<input id="empDate" name="empDate" type="date" disabled /> | ||
|
||
<label for="resume">Resume:</label> | ||
<input name="resume" type="file" /> | ||
<input id="resume" name="resume" type="file" /> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<form> | ||
<label for="amount">How many tickets? (You can buy 2-6 tickets)</label> | ||
<input name="amount" type="number" min="2" max="6" value="4" /> | ||
<input id="amount" name="amount" type="number" min="2" max="6" value="4" /> | ||
|
||
<label for="dep">Departure Date: (Whole year 2022 is acceptable)</label> | ||
<input name="dep" type="date" min="2022-01-01" max="2022-12-31" value="2025-05-05" /> | ||
<input id="dep" name="dep" type="date" min="2022-01-01" max="2022-12-31" value="2025-05-05" /> | ||
|
||
<label for="ret">Return Date: (Whole year 2022 is acceptable)</label> | ||
<input name="ret" type="date" min="2022-01-01" max="2022-12-31" /> | ||
<input id="ret" name="ret" type="date" min="2022-01-01" max="2022-12-31" /> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<form> | ||
<label for="email">Email Address:</label> | ||
<input name="email" type="email" value="na@[email protected]" /> | ||
<input id="email" name="email" type="email" value="na@[email protected]" /> | ||
|
||
<label for="secret">Secret Code: (lower case letters)</label> | ||
<input name="secret" type="text" value="test" pattern="[a-z]+" /> | ||
<input id="secret" name="secret" type="text" value="test" pattern="[a-z]+" /> | ||
|
||
<label for="age">Your age: (18+)</label> | ||
<input name="age" type="number" value="5" min="18" /> | ||
<input id="age" name="age" type="number" value="5" min="18" /> | ||
|
||
<label><input name="tos" type="checkbox" required checked /> - Do you agree to ToS?</label> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<form> | ||
<label for="amount">How many tickets? (You can buy 2-6 tickets)</label> | ||
<input name="amount" type="number" min="2" max="6" value="4" /> | ||
<input id="amount" name="amount" type="number" min="2" max="6" value="4" /> | ||
|
||
<label for="dep">Departure Date: (Whole year 2022 is acceptable)</label> | ||
<input name="dep" type="date" min="2022-01-01" max="2022-12-31" value="2025-05-05" /> | ||
<input id="dep" name="dep" type="date" min="2022-01-01" max="2022-12-31" value="2025-05-05" /> | ||
|
||
<label for="ret">Return Date: (Whole year 2022 is acceptable)</label> | ||
<input name="ret" type="date" min="2022-01-01" max="2022-12-31" /> | ||
<input id="ret" name="ret" type="date" min="2022-01-01" max="2022-12-31" /> | ||
</form> |
6 changes: 3 additions & 3 deletions
6
live-examples/css-examples/pseudo-class/placeholder-shown.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<form> | ||
<label for="name">Full Name:</label> | ||
<input name="name" type="text" /> | ||
<input id="name" name="name" type="text" /> | ||
|
||
<label for="email">Email Address:</label> | ||
<input name="email" type="email" placeholder="[email protected]" /> | ||
<input id="email" name="email" type="email" placeholder="[email protected]" /> | ||
|
||
<label for="age">Your age:</label> | ||
<input name="age" type="number" value="18" placeholder="You must be 18+" /> | ||
<input id="age" name="age" type="number" value="18" placeholder="You must be 18+" /> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,13 @@ | |
|
||
<form> | ||
<label for="email">Email Address:</label> | ||
<input name="email" type="email" value="[email protected]" /> | ||
<input id="email" name="email" type="email" value="[email protected]" /> | ||
|
||
<label for="note">Short note about yourself:</label> | ||
<textarea name="note">Don't be shy</textarea> | ||
<textarea id="note" name="note">Don't be shy</textarea> | ||
|
||
<label for="pic">Your picture:</label> | ||
<input name="pic" type="file" /> | ||
<input id="pic" name="pic" type="file" /> | ||
|
||
<input type="submit" value="Submit form" /> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,13 @@ | |
|
||
<form> | ||
<label for="email">Email Address:</label> | ||
<input name="email" type="email" value="[email protected]" /> | ||
<input id="email" name="email" type="email" value="[email protected]" /> | ||
|
||
<label for="note">Short note about yourself:</label> | ||
<textarea name="note">Don't be shy</textarea> | ||
<textarea id="note" name="note">Don't be shy</textarea> | ||
|
||
<label for="pic">Your picture:</label> | ||
<input name="pic" type="file" /> | ||
<input id="pic" name="pic" type="file" /> | ||
|
||
<input type="submit" value="Submit form" /> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<form> | ||
<label for="email">Email Address:</label> | ||
<input name="email" type="email" value="na@[email protected]" /> | ||
<input id="email" name="email" type="email" value="na@[email protected]" /> | ||
|
||
<label for="secret">Secret Code: (lower case letters)</label> | ||
<input name="secret" type="text" value="test" pattern="[a-z]+" /> | ||
<input id="secret" name="secret" type="text" value="test" pattern="[a-z]+" /> | ||
|
||
<label for="age">Your age: (18+)</label> | ||
<input name="age" type="number" value="5" min="18" /> | ||
<input id="age" name="age" type="number" value="5" min="18" /> | ||
|
||
<label><input name="tos" type="checkbox" required checked /> - Do you agree to ToS?</label> | ||
</form> |
2 changes: 1 addition & 1 deletion
2
live-examples/css-examples/pseudo-element/file-selector-button.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<label for="avatar">Choose a profile picture:</label><br /> | ||
|
||
<input type="file" name="avatar" accept="image/png, image/jpeg" /> | ||
<input id="avatar" type="file" name="avatar" accept="image/png, image/jpeg" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<label for="first-name">Your phone number:</label><br /> | ||
|
||
<input type="tel" name="phone" minlength="9" maxlength="9" placeholder="It must be 9 digits" /> | ||
<input id="first-name" type="tel" name="phone" minlength="9" maxlength="9" placeholder="It must be 9 digits" /> |
4 changes: 2 additions & 2 deletions
4
live-examples/html-examples/form-attributes/attribute-accept.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<label for="movie">Choose a movie to upload:</label> | ||
|
||
<input type="file" name="movie" accept="video/*" /> | ||
<input type="file" id="movie" name="movie" accept="video/*" /> | ||
|
||
<label for="poster">Choose a poster:</label> | ||
|
||
<input type="file" name="poster" accept="image/png, image/jpeg" /> | ||
<input type="file" id="poster" name="poster" accept="image/png, image/jpeg" /> |
8 changes: 4 additions & 4 deletions
8
live-examples/html-examples/form-attributes/attribute-disabled.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<form> | ||
<label for="name">Name:</label> | ||
<input name="name" type="text" /> | ||
<input id="name" name="name" type="text" /> | ||
|
||
<label for="emp">Employed:</label> | ||
<select name="emp" disabled> | ||
<select id="emp" name="emp" disabled> | ||
<option>No</option> | ||
<option>Yes</option> | ||
</select> | ||
|
||
<label for="empDate">Employment Date:</label> | ||
<input name="empDate" type="date" disabled /> | ||
<input id="empDate" name="empDate" type="date" disabled /> | ||
|
||
<label for="resume">Resume:</label> | ||
<input name="resume" type="file" /> | ||
<input id="resume" name="resume" type="file" /> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
live-examples/html-examples/form-attributes/attribute-maxlength.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<label for="name">Product name:</label> | ||
<input name="name" type="text" value="Shampoo" minlength="3" maxlength="20" required /> | ||
<input id="name" name="name" type="text" value="Shampoo" minlength="3" maxlength="20" required /> | ||
|
||
<label for="description">Product description:</label> | ||
<textarea name="description" minlength="10" maxlength="40" required></textarea> | ||
<textarea id="description" name="description" minlength="10" maxlength="40" required></textarea> |
4 changes: 2 additions & 2 deletions
4
live-examples/html-examples/form-attributes/attribute-min.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<label for="bet">How much would you like to bet? (0-100)</label> | ||
<input name="bet" type="number" min="0" max="100" value="25" /> | ||
<input id="bet" name="bet" type="number" min="0" max="100" value="25" /> | ||
|
||
<label for="color">Which color do you choose?</label> | ||
<input id="color" name="color" type="range" min="0" max="360" /> | ||
|
||
<label>Progress of the game:</label> | ||
<progress min="10" max="50" value="30"></progress> | ||
<progress max="50" value="30"></progress> |
4 changes: 2 additions & 2 deletions
4
live-examples/html-examples/form-attributes/attribute-minlength.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<label for="name">Product name:</label> | ||
<input name="name" type="text" value="Shampoo" minlength="3" maxlength="20" required /> | ||
<input id="name" name="name" type="text" value="Shampoo" minlength="3" maxlength="20" required /> | ||
|
||
<label for="description">Product description:</label> | ||
<textarea name="description" minlength="10" maxlength="40" required></textarea> | ||
<textarea id="description" name="description" minlength="10" maxlength="40" required></textarea> |
6 changes: 3 additions & 3 deletions
6
live-examples/html-examples/form-attributes/attribute-multiple.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
<label for="recipients">Where should we send the receipt?</label> | ||
<input name="recipients" type="email" multiple /> | ||
<input id="recipients" name="recipients" type="email" multiple /> | ||
|
||
<label for="shakes">Which shakes would you like to order?</label> | ||
<select name="shakes" multiple> | ||
<select id="shakes" name="shakes" multiple> | ||
<option>Vanilla Shake</option> | ||
<option>Strawberry Shake</option> | ||
<option>Chocolate Shake</option> | ||
</select> | ||
|
||
<label for="payment">How would you like to pay?</label> | ||
<select name="payment"> | ||
<select id="payment" name="payment"> | ||
<option>Credit card</option> | ||
<option>Bank Transfer</option> | ||
</select> |
4 changes: 2 additions & 2 deletions
4
live-examples/html-examples/form-attributes/attribute-pattern.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<label for="username">Username: (3-16 characters)</label> | ||
<input name="username" type="text" value="Sasha" pattern="\w{3,16}" required /> | ||
<input id="username" name="username" type="text" value="Sasha" pattern="\w{3,16}" required /> | ||
|
||
<label for="pin">PIN: (4 digits)</label> | ||
<input name="pin" type="password" pattern="\d{4,4}" required /> | ||
<input id="pin" name="pin" type="password" pattern="\d{4,4}" required /> |
6 changes: 3 additions & 3 deletions
6
live-examples/html-examples/form-attributes/attribute-readonly.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<label for="firstName">First Name:</label> | ||
<input name="firstName" type="text" value="Adam" /> | ||
<input id="firstName" name="firstName" type="text" value="Adam" /> | ||
|
||
<label for="age">Age:</label> | ||
<input name="age" type="number" value="42" readonly /> | ||
<input id="age" name="age" type="number" value="42" readonly /> | ||
|
||
<label for="hobbies">Hobbies:</label> | ||
<textarea name="hobbies" readonly>Baseball</textarea> | ||
<textarea id="hobbies" name="hobbies" readonly>Baseball</textarea> |
6 changes: 3 additions & 3 deletions
6
live-examples/html-examples/form-attributes/attribute-size.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
live-examples/html-examples/form-attributes/attribute-step.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<label for="bet">How many copies do you need? (We sell in batches of 10)</label> | ||
<input name="bet" type="number" value="0" step="10" /> | ||
<input id="bet" name="bet" type="number" value="0" step="10" /> | ||
|
||
<label for="color">Which color would like to get?</label> | ||
<input id="color" name="color" type="range" min="0" max="360" step="60" /> | ||
|
||
<label for="date">When would you like to come? (We work every second day)</label> | ||
<input name="date" type="date" step="2" /> | ||
<input id="date" name="date" type="date" step="2" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<label for="week">Choose a week in May or June:</label> | ||
<label for="camp-week">Choose a week in May or June:</label> | ||
|
||
<input type="week" name="week" id="camp-week" min="2018-W18" max="2018-W26" required /> |