Learn localStorage by Building a Todo App - Step 10

Tell us what’s happening:

I cannot get past this step, despite following the instructions.

Step 10
Now that you’ve worked on opening and closing the modal, it’s time to get the values from the input fields, save them into the taskData array, and display them on the page.

To start, add a submit event listener to your taskForm element and pass in e as the parameter of your arrow function. Inside the curly braces, use the preventDefault() method to stop the browser from refreshing the page after submitting the form.


### Your code so far
taskForm.addEventListener("submit", e => {
  e.preventDefault(); 
  });

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Challenge Information:

Learn localStorage by Building a Todo App - Step 10

Hi!

Put some brackets around the “e”, that’s an arrow function with the event as an argument.

Thank you - it worked

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.