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 trialHamdi Elshahat
2,565 PointsEverything is well explained, But why he didn't select the ul instead of listDiv since ul is the closest parent to li?
The Event Object video everything is well explained, But why he didn't select the ul instead of listDiv since ul is the closest parent to li and it would never be removed even if we remove every single li element?
2 Answers
Steven Parker
231,110 PointsSelecting the <ul> should work the same for this particular list, but should other lists be added to the <div> later, the choice as shown would extend the highlighting effect to them also.
However, whether this advance planning is intentional or not is not clear from the video.
Daniel Medley
5,948 PointsBecause most things have been very unclear so far. He goes from saying parent which is UL to something completely different. I have no idea what he is doing.