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 Creating New DOM Elements

Stefan Cutajar
Stefan Cutajar
7,747 Points

Can't add list item

Hi, I'm having an issue to add the list item when I click the button the element don't add to the list. There are no errors in the console and I also tried to check again the code with the video but can't figure out whats wrong. This is a snapshot of my work space: https://w.trhou.se/yhr5ujxnlt

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! You're doing just fine! There's actually nothing wrong here. You've created the li and gotten it all set up. But an li must go inside either an ordered list or unordered list. You will then append the list item to the list and when that's done, you'll put the whole thing on the DOM. Keep in mind that merely creating an element in code doesn't actually put it in the DOM until you tell it to.

At this point in the series, you're exactly where you should be. This should not work at this point. There will be a short 5 question quiz after this video, and the following video will then show you how to take those elements you created and put them on the DOM.

Hope this helps! :sparkles:

Stefan Cutajar
Stefan Cutajar
7,747 Points

Thanks I have just seen the video that teach you how to append the item :)