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) Constructor Functions and Prototypes Making the UI Work

getting "Uncaught TypeError: Cannot set property 'innerHTML' of null"

I can't figure out why my playlist won't display. I've been looking at this code for too long.

https://w.trhou.se/91fn5mkefx

2 Answers

rydavim
rydavim
18,780 Points

In your app.js file, you just have a simple syntax error. When using getElementById(), you're already specifying that you're looking for an ID, so you don't include the #.

var playlistElement = document.getElementById('playlist'); // no # here

It's much harder to spot these things when you're looking at your own work. Happy coding! :)

you sir, are a life saver. cheers!

Bekah McDonald
Bekah McDonald
10,527 Points

Thanks rydavim... this helped me out too!