Skip to content

Commit f4d9be5

Browse files
committed
📝🤔Todo
1 parent 94172e9 commit f4d9be5

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

Todo/app.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,25 @@ function append(id, todo) {
6868
</li>
6969
`
7070
main.appendChild(ul)
71-
console.log(todoList);
72-
7371
}
7472

73+
74+
ul.addEventListener('click', (e) => {
75+
let inp = todoList.childNodes[1].children[0].id;
76+
let getInput = document.querySelector('.inp')
77+
let btn = e.target.classList.contains("btn-edit")
78+
if (btn) {
79+
if(e.target.id === inp){
80+
if(add){
81+
remove
82+
getInput.focus()
83+
}
84+
if(remove){
85+
add
86+
}
87+
}
88+
}
89+
90+
})
91+
7592
window.addEventListener("DOMContentLoaded", fetching)

0 commit comments

Comments
 (0)