Relative Content

Tag Archive for addeventlistener

in spotifyclone we add an event listener to next and previous when we click default folder it work proper but other folder this throw error

previous.addEventListener(“click”,()=>{ currentSong.pause() console.log(“previous was clicked”) let index = ganas.indexOf(currentSong.src.split(“/”).slice(-1)[0]) if((index-1) >= 0){ playMusic(ganas[index-1]) } }) Uncaught TypeError: Cannot read properties of undefined (reading ‘indexOf’) at HTMLImageElement.<anonymous> (revis.js:152:27) plese help in solving error addeventlistener New contributor PRohit Mishra is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out […]