Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript and the DOM (Retiring) Responding to User Interaction The Event Object

tyler borg
tyler borg
9,424 Points

I have no idea what he's asking us to do in this video.

About 3:30 in he asks us to 'fix' the handlers to get the desired behavior...what the hell is he asking us to do??

4 Answers

Steven Parker
Steven Parker
210,070 Points

Since the handler is attached to a container element, it will be triggered on an event that occurs on any element inside or on the list itself. He's asking that the handler action be limited to only working on list item elements.

If you continue on to about 4:00 in the video you will see an example solution with further explanation.

I agree, very confusing...

Jeffrey Holcomb
Jeffrey Holcomb
Full Stack JavaScript Techdegree Student 11,480 Points

The code within the event handlers is from the previous solution of using a for loop with the index variable of 'i'. The new solution does not use a for loop however, so we are to 'fix' the code to work without the for loop.

I have no idea what is going on anymore.