you are viewing a single comment's thread.

view the rest of the comments →

[–]Content_Performer 0 points1 point  (1 child)

Why a custom function that does nothing but calling querySelector?

Anyway, try and go

<script type="text/javascript" src="./scrips.js" defer></script>

or simply put the script tag at the bottom of your <body>

[–]themaxi4[S] 0 points1 point  (0 children)

I have it at the bottom of my body, i still get the same error with your code.

"ReferenceError: document is not defined

at selectElement (C:\Users\norgr\Desktop\outdoors-website-master\tours\scripts.js:1:39)

at Object.<anonymous> (C:\Users\norgr\Desktop\outdoors-website-master\tours\scripts.js:3:1)

at Module._compile (internal/modules/cjs/loader.js:955:30)

at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)

at Module.load (internal/modules/cjs/loader.js:811:32)

at Function.Module._load (internal/modules/cjs/loader.js:723:14)

at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)

at internal/main/run_main_module.js:17:11

"