Skip to content

Commit

Permalink
Draft test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
DagfinnRomen committed Oct 24, 2018
1 parent ce48263 commit 54d9879
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions _rules/SC2-4-6-descriptive-labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,48 @@ Label that is coded with the `<label>` element and describes the purpose of the
<input id="fname" type="text" name="fname"/>
```

#### Passed example 2

Label that that is coded with the `<p>` element and associated by the aria-labelledby attribute. The label describes the purpose of the associated element.

```html
<p id="label_fname">First name:</p>
<input aria-labelledby="label_fname" type="text" name="fname"/>
```

### Failed

#### Failed example 1

Description...
Label that is coded with the `<label>` element and does not describe the purpose of the associated element.

```html
<!-- code -->
<label for ="fname">Menu</label>
<input id="fname" type="text" name="fname"/>
```

#### Failed example 2

Label that that is coded with the `<p>` element and associated by the aria-labelledby attribute. The label does not describe the purpose of the associated element.

```html
<p id="label_fname">Menu</p>
<input aria-labelledby="label_fname" type="text" name="fname"/>
```

### Inapplicable

#### Inapplicable example 1

Description...
Hidden label.

```html
<!-- code -->
```

#### Inapplicable example 2

Label that is not associated with a form field element.

```html
<!-- code -->
Expand Down

0 comments on commit 54d9879

Please sign in to comment.