Created
July 5, 2019 04:03
-
-
Save sergey-shambir/14ffa9d74a4f17b3889cfcd359dc562c to your computer and use it in GitHub Desktop.
To-Do App JS, layer 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onPageLoaded() { | |
// ... | |
function createTodo() { | |
// ... | |
listenDeleteTodo(deleteBtn); | |
} | |
function listenDeleteTodo(element) { | |
element.addEventListener("click", (event) => { | |
element.parentElement.remove(); | |
event.stopPropagation(); | |
}); | |
} | |
// ... | |
} | |
document.addEventListener("DOMContentLoaded", onPageLoaded); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment