Add a click handler for task list elements