Hi all,
I’m very slowly trying to build a to-do list web app, and one of the functions I want to add is for a user to be able to click on a completed item and have that grayed and crossed out. I added the following class to my CSS:
.completed {
color: gray;
text-decoration: line-through;
}
And this function to my JS:
userList.addEventListener('click', function(ev) {
if (ev.target.tagName === 'LI') {
ev.target.classList.toggle('completed');
}
});
However, when I click on the li, it changes color to gray but does not appear crossed out. Any insights on why this is happening? (full code at https://codepen.io/srhbishop/pen/vYOPXBm)