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) Traversing the DOM Getting All Children of a Node with children

S Ananda
S Ananda
9,474 Points

Cannot find my mistake.

Have looked at this code over and over and cannot find the mistake. Even put it into Codepen and got no error codes. It must be one of those tiny things that you can't see in your own code. Would appreciate help finding the problem. Here's my Codepen doc if that will help. I can already feel that it going to be one of those duh moments. Don't know if those will ever go away...

http://codepen.io/Sadaajit/pen/oBOeqM

Savannah Lynn
Savannah Lynn
13,662 Points

Hi,

Are you using an updated browser? The syntax covered in this course are not supported by some older browsers. That would explain why it runs in codepen but not in your browser.

Also, what exactly is happening in your browser? Do you see any error messages in your console? Is part of your code running but not all?

not sure if this is it but you have your

const removeItemButton =  

like this in you code with no value and there is no semicolon either.

complete or remove the syntax:

const removeItemButton =

2 Answers

Chantal Jenkins
PLUS
Chantal Jenkins
Courses Plus Student 11,233 Points

If the mistake you are encountering is that you can't add an item to your list, I have found the problem:

It appears to be an order issue.

In the addItemButton.addEventListener portion of your JS file.

You have to have ul.appendChild(li); before the attachListItemButton(li);

S Ananda
S Ananda
9,474 Points

Thanks #Ella Ruokokoski and #Chantal Jenkins. Don't know how the partial variable got back in the code, as I had deleted the entire removeItemButton. Moved the attachListitemButtons(li) and now everything is working.