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 JavaScript and the DOM (Retiring) Making Changes to the DOM Appending Nodes

Robert Herron
Robert Herron
10,898 Points

Uncaught TypeError: Cannot read property 'value' of null at HTMLButtonElement.<anonymous> (app.js:27)

I ran the code exactly as written but when I try to type in a new li item nothing shows up and this error message appears. I even downloaded the final version and copy/pasted the .js content but the same error appeared. What does it mean and where is my error?

2 Answers

Samantha Atkinson
.a{fill-rule:evenodd;}techdegree seal-36
Samantha Atkinson
Front End Web Development Techdegree Graduate 39,992 Points

My guess would be without seeing your workspace is you didn't add the index at the end of ul variable like this:

let ul = document.getElementsByTagName('ul')[0];
Doron Geyer
Doron Geyer
Full Stack JavaScript Techdegree Student 13,897 Points

Also check that you added/spelled document correctly. If you just put in

let ul = getElementsByTagName('ul')[0];

or had a typo in like this

let ul = documnent.getElementsByTagName('ul')[0];

you will get that error.