Tell us what’s happening:
I’ve tried every rearrangement of syntax I can think of. Tried MDN and the forums. Can’t get it to pass.
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
resetButton.addEventListener("click",resetButton) => {};
// 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/124.0.0.0 Safari/537.36
Challenge Information:
Learn Basic String and Array Methods by Building a Music Player - Step 92
toan
May 7, 2024, 1:24am
2
The syntax for adding an event listener with a callback using arrow syntax should be:
item.addEventListener("eventName", () => {
//code for callback function
});
The funcion addEventListener
takes 2 agruments:
The event name
The callback function
4 Likes
It looks like the instructions ask you to leave the callback function empty, but you’ve placed a function there instead. An empty event listener on a click event might look like this:
element.addEventListener(“click”, () => {});
1 Like
system
Closed
November 5, 2024, 2:30pm
4
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.