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 Interactive Web Pages with JavaScript Traversing and Manipulating the DOM with JavaScript Perform: Appending and Removing Elements

Tommy Tayler
Tommy Tayler
11,549 Points

Add Button won't work

Hi there, It seem my add button won't add the new item to the list.

https://w.trhou.se/j192n3gan3 Here is a snapshot of my code,

also i try to use the developer tools in chrome to find out if i had and errors and i got 'Uncaught SyntaxError: Unexpected token <' on line 100 so I'm wondering if my for loop has anything to do with it


1 Answer

Just looking quickly, looks like a syntax error on line 100.

// Your code
for(var i = 0, i < completeTasksHolder.children.length; i++){

// Just used a comma instead of a semicolon
for (var i = 0; i < completeTasksHolder.children.length; i++) {
Tommy Tayler
Tommy Tayler
11,549 Points

Thank you very much, I thought i was something there but couldn't quite pick it up. cheers

No worries. Syntax errors are the bane of probably every developer at some point in time.