0
innerHTML error
https://code.sololearn.com/WnIjN3PENLp7/?ref=app I can't figure out what is wrong with this code. It keeps spiting out an innerHTML error.
6 Respostas
+ 6
Do not use onclick function inlined to HTML tags. JavaScript codes should be on the JS tab only. You should separate them according to their placement.
+ 4
Read here to understand why it happens and how to fix it
https://www.sololearn.com/post/7444/?ref=app
+ 2
Upper Cast HTML
+ 1
There are two ways to solve this, and I'll only give you hints.
1. What if document.getElementById doesn't work because the DOM hasn't loaded yet? Is the header variable working then?
2. What would happen if I used document.getElementById somewhere else in the code?
+ 1
Thanks guys.
https://code.sololearn.com/WnIjN3PENLp7/?ref=app
0
Thanks so much. From my research, I gathered that it was a loading problem, but I wasn't sure how to fix it. This solves my problem.