1$('#answer').on('click', function() {
2 feedback('hey there');
3});
4
5var counter = 0;
6
7function feedback(message) {
8
9 $('#feedback').remove();
10
11 $('.answers').append('<div id="feedback">' + message + ' ' + counter + '</div>');
12
13 counter++;
14}
15
1$(document).ready(function () {
2 $("#add").click(function () {
3 var newToDo = $("#newToDo").val();
4 if(newToDo.length > 0){
5 var anotherToDo = $("<p>" + newToDo + "</p>");
6 $("#toDoList").append(anotherToDo);
7 $("#newToDo").val(" ");
8
9 // later when you want to delete it
10 anotherToDo.remove();
11 }
12 });
13});
14