Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

Thanks

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.