mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-25 05:02:17 -04:00
fix(curriculum): Corrected question and its solution (#62876)
This commit is contained in:
@@ -145,36 +145,63 @@ Think about additional information helpful for users filling out the form.
|
||||
|
||||
## --text--
|
||||
|
||||
How is the `aria-describedby` attribute used in the example with the close button and modal dialog?
|
||||
Which of the following is the correct way to use the `aria-describedby` attribute inside of a form?
|
||||
|
||||
## --answers--
|
||||
|
||||
It is used to define the size of the close button.
|
||||
|
||||
### --feedback--
|
||||
|
||||
It helps users understand what happens when the close button is clicked.
|
||||
```html
|
||||
<form>
|
||||
<label for="password">Password:</label>
|
||||
<input type="password" id="password" aria-describedby="password-help" />
|
||||
<p id="password-help">Your password must be at least 8 characters long.</p>
|
||||
</form>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
It provides a label for the close button using a separate text.
|
||||
```html
|
||||
<form>
|
||||
<label for="password">Password:</label>
|
||||
<input type="password" id="password" aria-describedby="password" />
|
||||
<p id="password-help">Your password must be at least 8 characters long.</p>
|
||||
</form>
|
||||
```
|
||||
|
||||
### --feedback--
|
||||
|
||||
It helps users understand what happens when the close button is clicked.
|
||||
It helps users understand how the descriptive text is connected to the input field.
|
||||
|
||||
---
|
||||
|
||||
It associates the close button with a description of its action to assistive technologies.
|
||||
|
||||
---
|
||||
|
||||
It controls the color of the close button.
|
||||
```html
|
||||
<form>
|
||||
<label for="password">Password:</label>
|
||||
<input type="password" id="password" aria-describedby="password-help" />
|
||||
<p>Your password must be at least 8 characters long.</p>
|
||||
</form>
|
||||
```
|
||||
|
||||
### --feedback--
|
||||
|
||||
It helps users understand what happens when the close button is clicked.
|
||||
It helps users understand how the descriptive text is connected to the input field.
|
||||
|
||||
---
|
||||
|
||||
```html
|
||||
<form>
|
||||
<label for="password">Password:</label>
|
||||
<input
|
||||
type="password"
|
||||
id="password"
|
||||
aria-label="Your password must be at least 8 characters long."
|
||||
/>
|
||||
</form>
|
||||
```
|
||||
|
||||
### --feedback--
|
||||
|
||||
It helps users understand how the descriptive text is connected to the input field.
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
1
|
||||
|
||||
Reference in New Issue
Block a user