mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
fix(curriculum): fix wording for music player project step - 66 (#54137)
Co-authored-by: Joy Shaheb <khondokoralam@gmail.com>
This commit is contained in:
+2
-2
@@ -7,9 +7,9 @@ dashedName: step-66
|
||||
|
||||
# --description--
|
||||
|
||||
Use `const` and arrow syntax to define a function called `setPlayButtonAccessibleText`.
|
||||
To make the application more accessible, it is important that the play button describes the current song or the first song in the playlist.
|
||||
|
||||
This function will set the `aria-label` attribute to the current song, or to the first song in the playlist. And if the playlist is empty, it sets the `aria-label` to `"Play"`.
|
||||
Start by creating an empty arrow function called `setPlayButtonAccessibleText`.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
+3
-1
@@ -7,7 +7,9 @@ dashedName: step-68
|
||||
|
||||
# --description--
|
||||
|
||||
Use the `setAttribute` method on the `playButton` element to set an attribute named `"aria-label"`. For the value, use a `ternary` to set `song?.title` to `Play ${song.title}` or `"Play"` if there's no `song.title` available.
|
||||
The `setPlayButtonAccessibleText` function will set the `aria-label` attribute to the current song, or to the first song in the playlist. And if the playlist is empty, it sets the `aria-label` to `"Play"`.
|
||||
|
||||
Use the `setAttribute` method on the `playButton` element to set an attribute named `"aria-label"`. For the value, use a ternary to `set song?.title` to `Play ${song.title}` or `"Play"` if there's no `song.title` available.
|
||||
|
||||
Don't forget you need template interpolation here, so you need to use backticks.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user