Learn localStorage by Building a Todo App - Step 6

tried chapgbpt and it matched my code still give me this eroor

my code:
openTaskFormBtn.addEventListener(“click”, function() {

Step 6

Now, you will work on opening and closing the form modal.

In earlier projects, you learned how to add and remove classes from an element with el.classList.add() and el.classList.remove(). Another method to use with the classList property is the toggle method.

The toggle method will add the class if it is not present on the element, and remove the class if it is present on the element.


Add an event listener to the openTaskFormBtn element and pass in a click event for the first argument and an empty callback function for the second argument.

For the callback function, use the classList.toggle() method to toggle the hidden class on the taskForm element.

Now you can click on the “Add new Task” button and see the form modal.

Challenge Information:

Learn localStorage by Building a Todo App - Step 6

your code is correct but empty callback function if you remember is like this

openTaskFormBtn.addEventListener("click", () => {});

what you did is a regular function definition not arrow function