Skip to content

Instantly share code, notes, and snippets.

@sergey-shambir
Last active July 5, 2019 04:03
Show Gist options
  • Save sergey-shambir/d6ca44978d038d6ff11bd609c5b2536a to your computer and use it in GitHub Desktop.
Save sergey-shambir/d6ca44978d038d6ff11bd609c5b2536a to your computer and use it in GitHub Desktop.
To-Do App JS, layer 3
function onPageLoaded() {
// ...
function createTodo() {
// ...
}
function onClickTodo(event) {
if (event.target.tagName === "LI") {
event.target.classList.toggle("checked");
}
}
// ...
ul.addEventListener("click", onClickTodo);
// ...
}
document.addEventListener("DOMContentLoaded", onPageLoaded);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment