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 jQuery Basics Understanding jQuery Events and DOM Traversal What is Traversal?

this should work...

why is this not accepted as a correct answer??

$('.student-list').on('click', (e)=>{});

when this is accepted as correct!!!

$('.student-list').on('click', function(event){ });

found this to be extremely annoying as it is correct and i wasted a lot of time trying to figure out why it was incorrect..................when it wasn't.

all I am doing is attempting to put what i have learnt into practice..... i.e. using e instead of using event.... and using an arrow function instead of the old fashioned way.....

1 Answer

Steven Parker
Steven Parker
220,865 Points

The arrow function is OK, but the challenge is expecting the parameter name to be "event". This becomes more clear once you see the instructions for task 2.

If you still feel this is a bug, you can report it to the Support staff.

I dont feel that it is a bug................however in the very same video Treasure explains how some devs use (event), some use (evt) but most abbreviate it to (e).......................i feel that any of those should be accepted as a correct answser. because at the end of the day the achieve the goal right?

i think the test should be a little less rigid, and not fail people for such minor trivial differences.

Steven Parker
Steven Parker
220,865 Points

You can also make suggestions like that to [Support].

Perhaps a more expedient fix might be a bit of re-wording.

For example, instead of "Be sure to pass in the event object to the callback function." it could say something like "Your callback function should have an event parameter."