-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
33 lines (22 loc) · 843 Bytes
/
script.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
import iconComplete from "./iconComplete.js";
import iconDelete from "./iconDelete.js";
const btn = document.querySelector(".btnCreate");
const createTask = (evento) => {
evento.preventDefault();
const input = document.querySelector(".inputForm");
const value_input = input.value;
input.value = "";
const list = document.querySelector(".cardsList");
const task = document.createElement("li");
task.classList.add("card");
const taskContent = document.createElement("div");
taskContent.appendChild(iconComplete());
const taskTitle = document.createElement("span");
taskTitle.classList.add("task");
taskTitle.innerHTML = value_input;
taskContent.appendChild(taskTitle);
task.appendChild(taskContent);
task.appendChild(iconDelete());
list.appendChild(task);
};
btn.addEventListener("click", createTask);