-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
27 lines (23 loc) · 871 Bytes
/
main.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
import checkComplete from "./COMPONET/checkComplete.js";
import deleteIcon from "./COMPONET/deleteIcon.js";
const btn = document.getElementById("form-btn");
const createTask = (evento) => {
evento.preventDefault();
const imput = document.querySelector("#form-imput");
const value = imput.value;
const list = document.getElementById("list");
const task = document.createElement("li");
task.classList.add("card");
imput.value = "";
const taskContent = document.createElement("div");
const titleTask = document.createElement("span");
titleTask.classList.add("task");
titleTask.innerText = value;
taskContent.appendChild(checkComplete());
taskContent.appendChild(titleTask);
// task.innerHTML = content;
task.appendChild(taskContent);
task.appendChild(deleteIcon());
list.appendChild(task);
};
btn.addEventListener("click", createTask);