Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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,813 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!