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: Changing Classes

Alan Sea
Alan Sea
6,781 Points

Unable to edit/delete List Items added by user...

https://w.trhou.se/x4hqxjnmv1

I can manipulate pre-populated tasks all I want and add any task I want to the list, but none of my additions can be edited or deleted and the console doesn't show any issues. Thoughts?

1 Answer

Hey Alan,

I looked at your code and it seems you are forgetting to run the bindTaskEvents function when you add a new task.

//Add a new task 
 var addTask = function() {
   console.log('Add task...');
  //Create a new list item with the text from the #new-task:
   var listItem = createNewTaskElement(taskInput.value);

   //Append listItem to incompleteTaskHolder
   incompleteTaskHolder.appendChild(listItem);
   bindTaskEvents(listItem, taskComplete);

 }