const btn = document.querySelector("[data-form-btn]");
const createTask = (evento) => {
evento.preventDefault();
const input = document.querySelector("[data-form-input]");
const value = input.value;
const list = document.querySelector("[data-list]")
const task = document.createElement("li");
task.classList.add("card");
input.value = "";
console.log(checkComplete());
//backticks
const taskContent = document.createElement("div");
taskContent.appendChild(checkComplete());
const titleTask = documen.createElement("span");
titleTask.classList.add("task");
titleTask.innerText = value;
taskContent.appendChild(titleTask);
const content = `
<i class="fas fa-trash-alt trashIcon icon"></i>`;
//task.innerHTML = content;
task.appendChild(taskContent);
list.appendChild(task);
console.log(content);
};
console.log(btn);
btn.addEventListener("click", createTask);
const checkComplete = () => {
const i = document.createElement("i");
i.classList.add("far");
i.classList.add("fa-check-square");
i.classList.add("icon");
}
Hola, hago paso a paso como en el video, pero a la hora de probrar el codigo, me marca un error, quisiera saber a que se debe.
Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. at HTMLButtonElement.createTask![]( )