Codex course

Module 6 of 14

Remove a Task You No Longer Need

Time: about 10 minutes

Difficulty: Beginner

No programming experience needed.

What you'll learn

  • How to remove one task while leaving the others alone.

Step-by-step instructions

  1. Type this message and press Return:
Codex message

Please add one small feature to my task list: put a “Remove” button beside every task. Do not make the button do anything yet. Tell me exactly how to check the change in my browser.

  1. Refresh the page.

How to check it worked: Each task has a Remove button.

  1. Type this message and press Return:
Codex message

Now make the “Remove” button work. When I click it, remove only that task from the list. Do not add any other features. Tell me exactly how to test this.

  1. Click Remove next to Buy groceries.

How to check it worked: Buy groceries disappears and Call Mum stays.

If something doesn't work

Codex message

I can see the Remove button, but clicking it does not remove the task. Please fix just that one problem.

What just happened?

Codex gave each task its own remove action. The app identifies which task belongs to the button you clicked, then takes only that task off the list.

You now have the three basic actions of a task list: add, finish, and remove.

Module checklist

  • Every task has a Remove button.
  • Removing one task leaves other tasks alone.

Next module: You will make your task list remember tasks after a refresh.