Hi,
I download the full source of js music player - https://www.codingnepalweb.com/create-music-player-in-javascript/ and it works perfectly with the given files.
However when i tried to add my own music file name to music-list.js, it throws the error - script.js:190 Uncaught DOMException: Failed to execute ‘querySelector’ on ‘Element’: ‘#001THUDHITHUPAADIDA’ is not a valid selector. (note: i have mp3, images and related files in the proper folder)
Can someone help me how to fix it? My entire music-list.js is below
// To add more song, just copy the following code and paste inside the array
// {
// name: "Here is the music name",
// artist: "Here is the artist name",
// img: "image name here - remember img must be in .jpg formate and it's inside the images folder of this project folder",
// src: "music name here - remember img must be in .mp3 formate and it's inside the songs folder of this project folder"
// }
//paste it inside the array as more as you want music then you don't need to do any other thing
let allMusic = [
{
name: "001 THUDHITHU PAADIDA",
artist: "Sarah Navroji",
img: "music",
src: "001THUDHITHUPAADIDA"
},
{
name: "002 KOADA KODI STHOTHIRAM",
artist: "Sarah Navroji",
img: "music",
src: "002KOADAKODISTHOTHIRAM"
},
{
name: "003 AANANDHAMAI NAAMAE",
artist: "Sarah Navroji",
img: "music",
src: "003AANANDHAMAINAAMAE"
},
{
name: "004INAIYILLANAAMAM",
artist: "Sarah Navroji",
img: "music",
src: "004INAIYILLANAAMAM"
},
{
name: "005 YESUVAI THUDHIYUNGAL",
artist: "Sarah Navroji",
img: "music",
src: "005YESUVAITHUDHIYUNGAL"
},
// like this paste it and remember to give comma after ending of this bracket }
// {
// name: "Here is the music name",
// artist: "Here is the artist name",
// img: "image name here - remember img must be in .jpg formate and it's inside the images folder of this project folder",
// src: "music name here - remember img must be in .mp3 formate and it's inside the songs folder of this project folder"
// }
];
Thanks