const notesForEmma = { tileOne: "hello", tileTwo: "emma", tileThree: "how", tileFour: "are", tileFive: "you", tileSix: "i", tileSeven: "think", tileEight: "you", tileNine: "are", tileTen: "a", tileEleven: "great", tileTwelve: "person", }; const note = document.querySelector(".read-this"); const tiles = document.querySelectorAll(".tile"); note.addEventListener("click", () => { tiles.forEach((el) => { el.addEventListener("click", () => { displayNote(el); }); }); }); const displayNote = (noteName) => { console.log(`${notesForEmma[noteName.className.split(' ')[0]]}`); };