how to make my delete function/button work in javascript (todo list project)

Hello, for some reason i cant get my delete function to work. I need to delete each list anytime the delete button is clicked but the delete function doesn’t even register the button clicked. I’ve done everything possible but nothing is working. The add list function is the “addBtn” function. The delete function is the “iconBtn” function. I’ve tried putting the iconBtn function inside and outside the addBtn function but it still doesnt log the “button clicked” to the console like I specified Please help. I added the codepen below. CODE: https://codepen.io/Godswill-Obi-ndaji/pen/oNJYwmQ
6 Replies
vince
vince15mo ago
#how-to-ask-good-questions
Will45
Will4515mo ago
Alrigh, how do I rephrase?
Rägnar O'ock
Rägnar O'ock15mo ago
Well, if you have not read the link thread you can start there. If you did, you can first put all the code you've put in the post in a codepen.io https://pen.new/
CodePen
...
chukwuebuka65
chukwuebuka6515mo ago
The iconBtn eventListener is not registering because it’s inside another event listener which is the addBtn event listener. Move it outside. The event will only register when you click the addBtn. Click the addBtn and then click the iconBtn , you will see the log to the console. So you need to move it outside that function.
Will45
Will4515mo ago
Will45
Will4515mo ago
Oh i’ve tried that. I’ve tried putting it both outside and inside the addBtn, still doesnt work. The codepen: https://codepen.io/Godswill-Obi-ndaji/pen/oNJYwmQ
Want results from more Discord servers?
Add your server