forked from CoffeeMensch/ToDoList
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
37 lines (28 loc) · 951 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
let addMessage = document.querySelector("input");
let toDoList = [];
let newToDoList = {
toDo: addMessage.value,
checked: false,
importent: false
};
function addDataWithButton() {
toDoList.push(newToDoList);
displayMessage();
}
function displayMessage() {
toDoList.forEach(function (item, index) {
let displayConsol = `Inf: ${addMessage.value}`
console.log(displayConsol);
let toDoContayner = document.getElementById("toDoContayner");
toDoContayner.firstElementChild.style.visibility = 'visible';
let text_elem = document.querySelector('.text_elem');
/* let span = document.querySelector('span');
span.innerText = addMessage.value;*/
let spann = document.createElement('span');
let p = document.createElement('p');
spann.innerText = addMessage.value;
text_elem.append(spann);
text_elem.append(p);
spann++;
})
}