I have this code here in VSCode:
const form = document.querySelector('form');
The error I am getting is:
C:\Program Files\nodejs\node.exe boot.js
helloworld
c:\Users\frase\OneDrive\Desktop\html\boot.js:2
const form = document.querySelector('form');
^
ReferenceError: document is not defined
at Object.<anonymous> (c:\Users\frase\OneDrive\Desktop\html\boot.js:2:14)
at Module._compile (internal/modules/cjs/loader.js:1157:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1177:10)
at Module.load (internal/modules/cjs/loader.js:1001:32)
at Function.Module._load (internal/modules/cjs/loader.js:900:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
Why is the document not working? The file name is referenced with the html file as <script src="boot.js"></script>
I have tried putting the script in the header and body tags.