We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8613b41 commit 4100a1bCopy full SHA for 4100a1b
projects/6-to-do-list/js/to-do.js
@@ -5,9 +5,11 @@ var newToDo = document.getElementById('todo-add-new');
5
var addToDo = function() {
6
var txt = document.createTextNode(newToDo.value);
7
var item = document.createElement("li");
8
+ var count = toDoList.children.length;
9
10
if(newToDo.value) {
11
item.appendChild(txt);
12
+ item.id = "todo-item-" + (count + 1);
13
toDoList.appendChild(item);
14
newToDo.value = "";
15
};
0 commit comments