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

Tell us what’s happening:

The step asks for variables to be created, and then to be assigned to HTML elements. When I go to check the code, I get the message "You should have a variable called ‘playlistSongs’ which I do. Are these projects and exercises still being maintained?

Your code so far

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

/* file: styles.css */

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

const playlistSongs = getElementByID("#playlist-songs");
const playButton = getElementByID("#play");
const pauseButton = getElementByID("#pause");

// 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/123.0.0.0 Safari/537.36

Challenge Information:

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

Hi there! Check the method’s name, it’s camelCased

Thank you for checking this! I have updated my code to use the method correctly, but it still tells me that my variable isn’t correct. I have also tried var and let.

getElementById is an method on document.

document.getElementById('someId')

Also, the method does not take the # in the selector string you pass it as an argument because it can only select ids so the # is implied.

If it was querySelector you would need the #

1 Like

Thank you…I have gotten the step cleared.