Created
October 1, 2017 08:17
-
-
Save tkssharma/2e06c0fbf06c5caae6daa2a60cd657a9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
document.addEventListener('DOMContentLoaded', function() { | |
let app = document.getElementById('todo-app'); | |
// attach event listener to whole container | |
app.addEventListener('click', function(e) { | |
if (e.target && e.target.nodeName === 'LI') { | |
let item = e.target; | |
alert('you clicked on item: ' + item.innerHTML); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment