Learn Basic String and Array Methods by Building a Music Player - Step 61

Tell us what’s happening:


seems like fCC is actively updating the courses and steps: the below problem happens to be step 61 as of 21st April 2024

Using an arrow syntax, create a “highlightCurrentSong” function. Inside the function, use “querySelectorAll” to get the ".playlist-song " element and assign to a “playlistSongElements” constant.

My Code:

const highlightCurrentSong = () => {
const playlistSongElements = document.querySelectorAll(“playlist-song”)

Result: code not validated

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

const highlightCurrentSong = () => {
 playlistSongElements = document.querySelectorAll("playlist-song");

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge Information:

Learn Basic String and Array Methods by Building a Music Player - Step 61

Hi @sphc648brr

You should create a playlistSongElements constant inside your highlightCurrentSong function.

I highlighted the keyword in bold.

Happy coding

if you want to select a class you need to put the period in front of the class name

Thanks, it works, though it didn’t work for a long time (from last week) !!!

exact code:

const highlightCurrentSong = ( ) => {
const playlistSongElements = document.querySelectorAll(“.playlist-song”);

1 Like

if you were using the code you posted earlier, the missing dot is pretty important

that is correct, I tried everything though, “currentSong.playlist”, .playlist, etc but it works now, i didn’t try the (“.playlist” ) - double quotes with dot in front, variation, until just now, thanks