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

Nicholas Suraci
Nicholas Suraci
7,543 Points

I copied the from the project files just in case my code was incorrect but it doesn't add the li to the ul

I was following along with the video on vs code, when I completed this part of the course I went to preview what the code does, it doesn't actually add an li to the ul. I even opened the final folder to see if it was something I missed but when you type something into the text box it still does nothing to the ul, I even switched from vs code to see if it would work on the work space and still nothing. I don't know if I'm doing something wrong but if anyone can help me with this that would be awesome!

Can you post a snapshot of your workspace? It is the camera icon in the upper right corner.

1 Answer

7,280 Points

I had to edit the last two variables to read as follows:

const addItemInput = document.querySelector('.addItemInput');
const addItemButton = document.querySelector('.addItemButton');
Adam Dashi
Adam Dashi
5,987 Points

I had the same problem - been driving me mad for a while and this solved it.