|
|
|
@ -34,6 +34,13 @@ form?.addEventListener("submit", (e) => {
|
|
|
|
|
function addListItem(task: Task) {
|
|
|
|
|
const item = document.createElement("li");
|
|
|
|
|
const label = document.createElement("label");
|
|
|
|
|
// const label = document.createElement("p") as HTMLElement;
|
|
|
|
|
const textInside = label.innerHTML as string;
|
|
|
|
|
// const textInside = (label.innerHTML = "<input></input>" as string);
|
|
|
|
|
console.log(textInside);
|
|
|
|
|
label.addEventListener("click", function () {
|
|
|
|
|
label?.focus();
|
|
|
|
|
});
|
|
|
|
|
const deletebtn = document.createElement("button");
|
|
|
|
|
const editbtn = document.createElement("button");
|
|
|
|
|
deletebtn.classList.add("deletebtn");
|
|
|
|
@ -54,7 +61,7 @@ function addListItem(task: Task) {
|
|
|
|
|
item.parentNode?.removeChild(item);
|
|
|
|
|
});
|
|
|
|
|
editbtn.addEventListener("click", function () {
|
|
|
|
|
label.blur();
|
|
|
|
|
label?.focus();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|