Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![LETITA BUZEA](https://uploads.teamtreehouse.com/production/profile-photos/11652769/micro_poza_leti.jpg)
LETITA BUZEA
Full Stack JavaScript Techdegree Student 4,247 PointsClicking on one of the list items makes them all disappear
I wrote the code as instructed in the video. The buttons work, but the list items disappear all at once if I click on one of them.
![Unsubscribed User](https://secure.gravatar.com/avatar/78dbdbf9158c7e5c838fcaceb9f58f47?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Unsubscribed User
7,943 PointsHave you changed the event listener parameter to 'click' instead of 'mouseover'?
2 Answers
![Jason Larson](https://uploads.teamtreehouse.com/production/profile-photos/11651180/micro_JLarson-Crop3.jpg)
Jason Larson
8,359 PointsMake sure in the taskList.addEventListener function that you change your if statement to look for the tagName button instead of LI, as below.
taskList.addEventListener("click", (event) => {
if (event.target.tagName == "BUTTON") {
let button = event.target;
let li = button.parentNode;
li.remove();
}
});
![Stephen Cole](https://secure.gravatar.com/avatar/c318b8e289f72d3e9b157df9785c598a?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Stephen Cole
Courses Plus Student 15,809 PointsI found that, if mouseover
is the action type and you hover over the first item, each item moves up and triggers the event.
If you move your mouse around the list and start at the bottom, they will be deleted one at a time.
Joseph Yhu
PHP Development Techdegree Graduate 48,637 PointsJoseph Yhu
PHP Development Techdegree Graduate 48,637 PointsCould you provide us with your code so we can have a look at it?