Skip to content

Commit

Permalink
changed note delete function to use event listener
Browse files Browse the repository at this point in the history
  • Loading branch information
yavor-kaludov committed Apr 20, 2024
1 parent ecafa17 commit e66014b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/note_management.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function showNotes() {
noteElement.querySelector("[data-note-text]").textContent = note;

const noteDeleteButton = noteElement.querySelector("[data-note-delete-button]");
noteDeleteButton.onclick = function() {deleteNote(index)};
noteDeleteButton.addEventListener("click", () => deleteNote(index));

notesList.append(noteElement);
});
Expand Down

0 comments on commit e66014b

Please sign in to comment.