How to fix “Cannot read property ‘addEventListener’ of null” error [duplicate]
You are loading the Javascript file in the <head>, before the body of your HTML Is loaded. Therefore your line Has nothing to look up – your button with class guessSubmit doesn’t exist yet. And since guessSubmit is null, it does not contain any properties, hence the error. The easiest solution is to put your … Read more