Build a Music Player - Step 20

Tell us what’s happening:

here i did what it required and i succeed play the list as it be but i still can’t pass the test,
any hint here ? thank you.

Your code so far

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

/* file: styles.css */

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

songs.forEach((song) => {
  song.addEventListener('click', () => {
    playSong(+song.id.split('-')[1])
  })
});

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

Challenge Information:

Build a Music Player - Step 20

Look at the HTML for playlist-songs. Each song is a li element. And you need to add an event listener to each button withing song.

1 Like

thank you so much for helping me