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

6,657 Points

Nothing happens when I move tasks from one status to another

At 6:10 in the video, we see that to-do tasks marked completed go to completed list. When we click a completed task to move it back to the to-do list, nothing happens. I see the teacher fixing that, but I don't understand why its not happening without the fix. Please explain.

Wait...I answered my own question. Brain fart moment there.

  1. The code binds the event handler taskIncomplete to the checkbox of each completed task.
  2. When the checkbox of a completed task is unchecked, taskIncomplete is triggered and moves the completed task to incomplete group. Note that the checkbox of the moved task is still bound to taskIncomplete which will keep moving it to the incomplete group upon clicking its checkbox.

So, taskIncomplete must not only move a completed task to incomplete group, but it must also make it possible for the task to be changed from incomplete status to complete.To do this, taskIncomplete must bind the checkbox of the moved task to taskCompleted. Code to be added to taskIncomplete is bindTaskEvents(listItem, taskcompleted);