Learn localStorage by Building a Todo App - Step 10

Tell us what’s happening:

I’m stuck on this one any examples of solution would be helpful thanks.

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

taskForm.addeventListener("submit", (e) => {
e.preventDefault();// Prevent default form submission behaviour
});

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1.1 Safari/605.1.15

Challenge Information:

Learn localStorage by Building a Todo App - Step 10

Your answer is essentially correct; you just forgot to capitalize the “E” at the start of the word “Event” in addEventListener.

Thanks for that although I made the corrections I think there must be an error or bug with system to pass this task. Does it work at your end?

Did it work at your end?

Try removing the comment before you run the tests.

1 Like

As @fcc4b6d10c4-b540-4e2 suggested, it works when you remove the comment.

Remove the task and reattaching it I don’t get it do you mean flagging on here in the community?

Sorry, your code does not pass. Keep trying.

You should call the addEventListener() method on your taskForm variable.

you should remove the comment you added in the code. Do you remember what a comment in JavaScript is?

Yes I know what comments are, how’s this?

taskForm.addeventListener("submit", (e) => {

e.preventDefault();

});

that is not formatted correctly, you need to select the code you want to format before pressint the Preformatted text button.

Alternatively:

  • write on a line three backticks on their own (they must be the only thing in the line)
  • then write your code
  • then write three backticks on their own in a line

In that code you have a typo, check the name of the method:

Dough thanks for the correction.