Assignment 5 autograder 'document is not defined'

Hi guys, I’m currently getting a few autograder messages which are all about document not being defined within my formSubmission() and addDestinationInfo() functions.

I had taken out document as a parameter in both of these functions, as I kept getting an error in the console as I was coding it, which said “document is undefined”. When I took out document as a parameter, the error went away AND everything is working exactly as it should in my program. But now this error is back. How do you define document? I just thought you could use it straightaway to refer to elements in the HTML, i.e. let form = document.querySelector(“form”);

Document = window.document at the top of the script.js Just below the load and then use window.document when calling the submission function on script.js. But you do need document as a parameter in the submission function in helperScript.js too

1 Like