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

Tell us what’s happening:

I am confused what I am missing here.

Your code so far

playButton.classList.add(playing)

audio.play()

Your browser information:

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

Challenge Information:

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

The playing class is a string, not a variable.

element.classList.add("someClass")
1 Like

so it should be:

playButton.classlist.add("playing");
audio.play();

correct>?

It is classList camel case, uppercase L

I have blurred the code just to avoid spoilers.

this works for me:

playButton.classList.add(‘playing’);

audio.play();

I’m really confused about what I’m supposed to be making the code do here. When I look up the add() method it only talks about sets which haven’t been covered yet, to my memory. Can you explain what the add method is doing and why playButton.classList would be considered a set?

Not sure what docs you are looking at but they do not sound like the correct ones.

1 Like

I just googled “add() method javascript”.

Thank you for these alternative resources. I honestly didn’t get what I was trying to achieve, but I’m looking into these now.

It sounds like you were reading these docs which is for a different concept

1 Like