I am using the tutorial from w3schools that lets you click on an item in a list and change the color of the background. I need to take the string from the list item and do something with it. So, I am starting with just writing to the console log.
// Add a "checked" symbol when clicking on a list item
var list = document.querySelector('ul');
list.addEventListener('click', function(ev) {
if (ev.target.tagName === 'LI') {
ev.target.classList.toggle('checked');
var result = document.getElementsBytagName('LI').innerHTML;
console.log(result);
}
}, false);`
Thanks