i displayed some songs from firebase database to cards, i assigned the id of the cards dynamically, i want to use the id to play song on clicking it. But i am unable to use the playsong.addeventlistener. Error shows : playsong is undefined. what am i doing wrong?
onChildAdded(dbRef, (snapshot) => {
var childKey = snapshot.key;
console.log(childKey);
var childData = snapshot.val();
console.log(childData.SongName);
let card = document.createElement("div");
card.className = 'card';
card.id = 'playsong';
card.style.backgroundImage = "url('https://firebasestorage.googleapis.com/v0/b/soundemic-4f707.appspot.com/o/"+childData.SongName+"%2FThumbnail?alt=media&token=c34ebabe-4bbd-4659-b4e4-ff22221376cb')";
document.querySelector(".fresh-album-cards").appendChild(card);
}), {
onlyOnce: true
};