Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Object-Oriented JavaScript (2015) Practice Project User Interface Code

John Bastian Bolhano
John Bastian Bolhano
4,800 Points

Cannot set property 'innerHTML' of null

I tried to copy what's in the video but my code doesn't work.

https://w.trhou.se/7c6efvu6dx

It outputs an error like this

quiz_ui.js:31 Uncaught TypeError: Cannot set property 'innerHTML' of null
    at Object.populateIdWidthHTML (quiz_ui.js:31)
    at Object.displayProgress (quiz_ui.js:42)
    at Object.displayNext (quiz_ui.js:11)
    at app.js:18

quiz_ui.js:31 Uncaught TypeError: Cannot set property 'innerHTML' of null
    at Object.populateIdWidthHTML (quiz_ui.js:31)
    at Object.displayProgress (quiz_ui.js:42)
    at Object.displayNext (quiz_ui.js:11)
    at HTMLButtonElement.button.onclick (quiz_ui.js:37)

3 Answers

Natalie Cluer
Natalie Cluer
18,896 Points

Hi! when you call the function, you misspelled the id. you have "progess" instead of "progress".

John Bastian Bolhano
John Bastian Bolhano
4,800 Points

Thank you for the help. How did you find the error?

Natalie Cluer
Natalie Cluer
18,896 Points

A lot of the time when there is an error setting the property it is because you are trying to set something that the JS program cannot find. The first place I usually look is where the function is called and follow the trail from there.

John Bastian Bolhano
John Bastian Bolhano
4,800 Points

Thank you for the suggestion. I saw another problem and did follow what you have suggested and it works. Thanks again!

Natalie Cluer
Natalie Cluer
18,896 Points

no problem! Happy coding!:)