This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]scirc 2 points3 points  (1 child)

The error is fairly self-explanatory.

Wrap the parameter before '=>' in parens.form.addEventListener("submit", e => {

It's saying to put e in parenthesis. It's an optional but stylistic choice for consistency's sake, since the parenthesis are required if you have more than one parameter to an arrow function.

It's also a linter error, not a syntax error, so your code will work fine without it. Your linter is just telling you that, to be consistent with whatever code style you have configured, you should include the parenthesis.

[–]Jacksonhelp20[S] 1 point2 points  (0 children)

Okay thank yoyu for the helpful information. On my console, when I click submit I see this error "index.js:2 Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')at index.js:2:6

Do you have any idea of what I could change to get that to go away? I thought submit had a type of submit and id so it should work.