Tell us what’s happening:
hello can you help, im not sure where to use onclick method, from the step text i understood that it should be used on song title but it gives me an error , i also tried puting it at the end of the buitton but it also didnt work
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
<button class="playlist-song-info">
<span class="playlist-song-title">${song.title}.onclick=playSong(${song.id})</span>
<span class="playlist-song-artist">${song.artist}</span>
<span class="playlist-song-duration">${song.duration}</span>
</button>
// 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/126.0.0.0 Safari/537.36
Challenge Information:
Learn Basic String and Array Methods by Building a Music Player - Step 45