0
JavaScript Functions(Please Help)
I am working on a quiz game and I am having an error message come up. This is my quiz game https://code.sololearn.com/WbuqxDa17ru7/# and the message is TypeError: Cannot set property 'innerHTML' of null at addQuestion (<anonymous>:108:31) at generateQuiz (<anonymous>:134:4) at start (<anonymous>:74:4) at HTMLButtonElement.onclick I have no idea how to fix this. Please help anyone. Thank you, -Trevor
3 odpowiedzi
+ 2
This post has the answer
https://www.sololearn.com/post/90825/?ref=app
+ 1
im going to try my best here to help you. base on Ipang post, it looks like your javascript is running before the elements are created. i would imagine it could help if you moved your html code to the top.
i would also imagine you could move your css to the css tab and your javascript to the javascript tab to make the html a little bit easier to read.
+ 1
when i moved you html to the top, all your questioned showed. i then got an error message when i clicked on the submit button. when i moved the submitbut function i got another error message and kind of gave up.
second error message.
ReferenceError: Can't find variable: showResults at Line: -37