Project Challenge 4: Moving a Task from To-do to Done

Move a task from the to-do list to done when the done button corresponding to that task element is clicked.

Problem statement

In this challenge, the task is this:

  • When the user clicks on one of the done button elements nested within a task, move the corresponding parent task element from the ā€œTo-doā€ list to the end of the ā€œDoneā€ list.

  • Additionally, remove the done button element from the corresponding task element.

šŸ“ Note: The done button element with an id of done is dynamically generated upon the addition of a new task. The click event handler $("#done").click() will not work so we will utilize the on() method.

Sample input

Click on the done button element corresponding to the ā€œComplete assignmentā€ task.

Sample output

The ā€œComplete assignmentā€ task is moved from the ā€œTo-doā€ to ā€œDoneā€, and the done button element is removed.

Coding exercise

The problem is designed for your practice, so you are encouraged to solve it on your own. If you are completely stuck, refer to the solution review in the next lesson for guidance.

Challenge: Moving a task from to-do to done